diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 3d990839..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,568 +0,0 @@ -# Changelog - -[npm history][1] - -[1]: https://www.npmjs.com/package/nodejs-tasks?activeTab=versions - -## [3.0.5](https://github.com/googleapis/nodejs-tasks/compare/v3.0.4...v3.0.5) (2022-11-10) - - -### Bug Fixes - -* **deps:** Use google-gax v3.5.2 ([#673](https://github.com/googleapis/nodejs-tasks/issues/673)) ([f3cc910](https://github.com/googleapis/nodejs-tasks/commit/f3cc9105e053e44e5503ae004c2151bd24125845)) -* update proto definitions ([42e0ebb](https://github.com/googleapis/nodejs-tasks/commit/42e0ebb5ce3cc0abdbfe95d2ee9ec2b5a0242cee)) -* Update proto definitions([#677](https://github.com/googleapis/nodejs-tasks/issues/677)) ([42e0ebb](https://github.com/googleapis/nodejs-tasks/commit/42e0ebb5ce3cc0abdbfe95d2ee9ec2b5a0242cee)) - -## [3.0.4](https://github.com/googleapis/nodejs-tasks/compare/v3.0.3...v3.0.4) (2022-09-22) - - -### Bug Fixes - -* **issue-640:** Adding headers in task request samples ([#642](https://github.com/googleapis/nodejs-tasks/issues/642)) ([d334d0d](https://github.com/googleapis/nodejs-tasks/commit/d334d0d6248088bd8695240c603d2f6dc8855c71)) -* Preserve default values in x-goog-request-params header ([#657](https://github.com/googleapis/nodejs-tasks/issues/657)) ([feb5188](https://github.com/googleapis/nodejs-tasks/commit/feb518818beed283b7bfaef5288921d482233a95)) -* Wrapping param inSeconds with parseInt to ensure correct addition ([#655](https://github.com/googleapis/nodejs-tasks/issues/655)) ([efdb0b8](https://github.com/googleapis/nodejs-tasks/commit/efdb0b8b1ad98207340bb5b2314315cd06c95bd7)) - -## [3.0.3](https://github.com/googleapis/nodejs-tasks/compare/v3.0.2...v3.0.3) (2022-09-01) - - -### Bug Fixes - -* Allow passing gax instance to client constructor ([#650](https://github.com/googleapis/nodejs-tasks/issues/650)) ([f26f795](https://github.com/googleapis/nodejs-tasks/commit/f26f795d0cc5d191b9f67904861d5fa9235244f8)) -* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-tasks/issues/1553)) ([#649](https://github.com/googleapis/nodejs-tasks/issues/649)) ([6802824](https://github.com/googleapis/nodejs-tasks/commit/68028244ec60f38d800adbc79517304ae7ac1031)) - -## [3.0.2](https://github.com/googleapis/nodejs-tasks/compare/v3.0.1...v3.0.2) (2022-08-23) - - -### Bug Fixes - -* better support for fallback mode ([#644](https://github.com/googleapis/nodejs-tasks/issues/644)) ([e3dc832](https://github.com/googleapis/nodejs-tasks/commit/e3dc83293c398631e9bdb26903a2d3be3d826af9)) -* change import long to require ([#645](https://github.com/googleapis/nodejs-tasks/issues/645)) ([5d2238b](https://github.com/googleapis/nodejs-tasks/commit/5d2238b0126314bc1b8f78715e85a97ad6a61e80)) -* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-tasks/issues/1546)) ([#648](https://github.com/googleapis/nodejs-tasks/issues/648)) ([e67689e](https://github.com/googleapis/nodejs-tasks/commit/e67689e0933252ab88fc2dfadc5e3cb75a0fb145)) - -## [3.0.1](https://github.com/googleapis/nodejs-tasks/compare/v3.0.0...v3.0.1) (2022-06-30) - - -### Bug Fixes - -* **docs:** describe fallback rest option ([#631](https://github.com/googleapis/nodejs-tasks/issues/631)) ([df558e9](https://github.com/googleapis/nodejs-tasks/commit/df558e95c7d1a92ba1133ba046e6bc33e840669b)) - -## [3.0.0](https://github.com/googleapis/nodejs-tasks/compare/v2.6.0...v3.0.0) (2022-06-07) - - -### ⚠ BREAKING CHANGES - -* update library to use Node 12 (#625) - -### Build System - -* update library to use Node 12 ([#625](https://github.com/googleapis/nodejs-tasks/issues/625)) ([411f5ab](https://github.com/googleapis/nodejs-tasks/commit/411f5ab3960cbc6768f7046102b88d22c203eb24)) - -## [2.6.0](https://github.com/googleapis/nodejs-tasks/compare/v2.5.0...v2.6.0) (2022-05-06) - - -### Features - -* AuditConfig for IAM v1 ([#611](https://github.com/googleapis/nodejs-tasks/issues/611)) ([176dcee](https://github.com/googleapis/nodejs-tasks/commit/176dcee213353a0a76b26a657172bea7a15f2ce5)) - -## [2.5.0](https://www.github.com/googleapis/nodejs-tasks/compare/v2.4.2...v2.5.0) (2021-12-09) - - -### Features - -* add eslintignore for sameple generated code ([#1302](https://www.github.com/googleapis/nodejs-tasks/issues/1302)) ([#582](https://www.github.com/googleapis/nodejs-tasks/issues/582)) ([bf99e4e](https://www.github.com/googleapis/nodejs-tasks/commit/bf99e4ecc1c46cfd84893ef0ab097d27f26f9139)) - -### [2.4.2](https://www.github.com/googleapis/nodejs-tasks/compare/v2.4.1...v2.4.2) (2021-09-10) - - -### Bug Fixes - -* **build:** set default branch to main ([#565](https://www.github.com/googleapis/nodejs-tasks/issues/565)) ([e486ef8](https://www.github.com/googleapis/nodejs-tasks/commit/e486ef834a07e246b5bc2a6d6854a99ea803b4b8)) - -### [2.4.1](https://www.github.com/googleapis/nodejs-tasks/compare/v2.4.0...v2.4.1) (2021-09-07) - - -### Bug Fixes - -* **deps:** require google-gax v2.24.1 ([#559](https://www.github.com/googleapis/nodejs-tasks/issues/559)) ([1b2b162](https://www.github.com/googleapis/nodejs-tasks/commit/1b2b162e6ad653f39c620bedcd32ca66818e7807)) - -## [2.4.0](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.6...v2.4.0) (2021-09-07) - - -### Features - -* turns on self-signed JWT feature flag ([#561](https://www.github.com/googleapis/nodejs-tasks/issues/561)) ([9fde4fe](https://www.github.com/googleapis/nodejs-tasks/commit/9fde4fe9a7274493ce0b4bb1a2d25bd85a3e9af2)) - -### [2.3.6](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.5...v2.3.6) (2021-07-16) - - -### Bug Fixes - -* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#549](https://www.github.com/googleapis/nodejs-tasks/issues/549)) ([96c505e](https://www.github.com/googleapis/nodejs-tasks/commit/96c505e04209689c7f1351a71eac270c9f68ca86)) - -### [2.3.5](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.4...v2.3.5) (2021-07-12) - - -### Bug Fixes - -* **deps:** google-gax v2.17.1 ([#546](https://www.github.com/googleapis/nodejs-tasks/issues/546)) ([dafe1b6](https://www.github.com/googleapis/nodejs-tasks/commit/dafe1b6cbf94fddc3fc4f5ac47eecf59e8173317)) - -### [2.3.4](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.3...v2.3.4) (2021-06-30) - - -### Bug Fixes - -* **deps:** google-gax v2.17.0 with mTLS ([#543](https://www.github.com/googleapis/nodejs-tasks/issues/543)) ([d1a715d](https://www.github.com/googleapis/nodejs-tasks/commit/d1a715d92e0136b1840798c2e122e165201715cd)) - -### [2.3.3](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.2...v2.3.3) (2021-06-30) - - -### Bug Fixes - -* make request optional in all cases ([#539](https://www.github.com/googleapis/nodejs-tasks/issues/539)) ([7c50042](https://www.github.com/googleapis/nodejs-tasks/commit/7c50042bca636dddc0e4407ef1d33ac01f1413da)) - -### [2.3.2](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.1...v2.3.2) (2021-05-25) - - -### Bug Fixes - -* GoogleAdsError missing using generator version after 1.3.0 ([#529](https://www.github.com/googleapis/nodejs-tasks/issues/529)) ([760c204](https://www.github.com/googleapis/nodejs-tasks/commit/760c2043f9bccb0d2787e83dd08ace942e6b10fd)) - -### [2.3.1](https://www.github.com/googleapis/nodejs-tasks/compare/v2.3.0...v2.3.1) (2021-05-12) - - -### Bug Fixes - -* **deps:** require google-gax v2.12.0 ([#519](https://www.github.com/googleapis/nodejs-tasks/issues/519)) ([8cee43a](https://www.github.com/googleapis/nodejs-tasks/commit/8cee43a5ffa7df38d809fac087454b1c6d848d53)) -* use require() to load JSON protos ([#522](https://www.github.com/googleapis/nodejs-tasks/issues/522)) ([3c367be](https://www.github.com/googleapis/nodejs-tasks/commit/3c367bed5218655dfa50adfed3eb655d2d632d31)) - -## [2.3.0](https://www.github.com/googleapis/nodejs-tasks/compare/v2.2.0...v2.3.0) (2021-01-22) - - -### Features - -* introducing fields: ListQueuesRequest.read_mask, GetQueueRequest .read_mask, Queue.task_ttl, Queue.tombstone_ttl, Queue.stats and introducing messages: QueueStats ([#499](https://www.github.com/googleapis/nodejs-tasks/issues/499)) ([d04ef73](https://www.github.com/googleapis/nodejs-tasks/commit/d04ef7311ac26ea17f44cfbc1acb980cb78fb149)) - -## [2.2.0](https://www.github.com/googleapis/nodejs-tasks/compare/v2.1.3...v2.2.0) (2021-01-09) - - -### Features - -* introduces style enumeration ([#496](https://www.github.com/googleapis/nodejs-tasks/issues/496)) ([680f1dc](https://www.github.com/googleapis/nodejs-tasks/commit/680f1dcd269d25247a54157108c524f8946dc624)) - - -### Bug Fixes - -* **samples:** remove unused variables ([#492](https://www.github.com/googleapis/nodejs-tasks/issues/492)) ([81c4b4e](https://www.github.com/googleapis/nodejs-tasks/commit/81c4b4ece21eb99cec582d3256192de6c402d771)) - -### [2.1.3](https://www.github.com/googleapis/nodejs-tasks/compare/v2.1.2...v2.1.3) (2020-11-25) - - -### Bug Fixes - -* **browser:** check for fetch on window ([6abe685](https://www.github.com/googleapis/nodejs-tasks/commit/6abe6853909b5c897b80854eaa5a7f8b1da26e0b)) -* do not modify options object, use defaultScopes ([#484](https://www.github.com/googleapis/nodejs-tasks/issues/484)) ([039becb](https://www.github.com/googleapis/nodejs-tasks/commit/039becb02c12ee0911d536edcfb796664c4b6525)) - -### [2.1.2](https://www.github.com/googleapis/nodejs-tasks/compare/v2.1.1...v2.1.2) (2020-10-27) - - -### Bug Fixes - -* **samples:** region tag collided with tasks-api ([#476](https://www.github.com/googleapis/nodejs-tasks/issues/476)) ([fd73aa4](https://www.github.com/googleapis/nodejs-tasks/commit/fd73aa473e60dc9624b7615242099a2bd056f61b)) - -### [2.1.1](https://www.github.com/googleapis/nodejs-tasks/compare/v2.1.0...v2.1.1) (2020-09-12) - - -### Bug Fixes - -* **deps:** update dependency yargs to v16 ([#460](https://www.github.com/googleapis/nodejs-tasks/issues/460)) ([7d24cda](https://www.github.com/googleapis/nodejs-tasks/commit/7d24cda00f73717b693a907c8bb09cbec864e024)) - -## [2.1.0](https://www.github.com/googleapis/nodejs-tasks/compare/v2.0.1...v2.1.0) (2020-07-06) - - -### Features - -* introducing field Queue.type docs: fixing typos and minor updates ([#426](https://www.github.com/googleapis/nodejs-tasks/issues/426)) ([d0c538c](https://www.github.com/googleapis/nodejs-tasks/commit/d0c538cca9e110d9af0b4a9116e230ac983869a6)) - - -### Bug Fixes - -* update node issue template ([#427](https://www.github.com/googleapis/nodejs-tasks/issues/427)) ([43a97a5](https://www.github.com/googleapis/nodejs-tasks/commit/43a97a56320b4c5486e5dc349d13b4dd709678e3)) - -### [2.0.1](https://www.github.com/googleapis/nodejs-tasks/compare/v2.0.0...v2.0.1) (2020-06-12) - - -### Bug Fixes - -* handle fallback option properly ([#425](https://www.github.com/googleapis/nodejs-tasks/issues/425)) ([0d4e8c9](https://www.github.com/googleapis/nodejs-tasks/commit/0d4e8c90f265d1275b6844eb91251eefc8e991be)) -* regen protos and tests, formatting ([#413](https://www.github.com/googleapis/nodejs-tasks/issues/413)) ([b05145e](https://www.github.com/googleapis/nodejs-tasks/commit/b05145eacbee28c7ca7f801f1c250269a3ab91b2)) -* remove eslint, update gax, fix generated protos, run the generator ([#400](https://www.github.com/googleapis/nodejs-tasks/issues/400)) ([45a3425](https://www.github.com/googleapis/nodejs-tasks/commit/45a3425f008286bc81fc577a1eb7ba8e625c62c0)) -* remove unused files from package ([#404](https://www.github.com/googleapis/nodejs-tasks/issues/404)) ([803bc49](https://www.github.com/googleapis/nodejs-tasks/commit/803bc499ca3b36955bbba009b072ee59660ef3de)) -* synth.py clean up for multiple version ([#415](https://www.github.com/googleapis/nodejs-tasks/issues/415)) ([b860452](https://www.github.com/googleapis/nodejs-tasks/commit/b860452e4e8c164bc118273c4e615f3ad91845b5)) - -## [2.0.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.9.0...v2.0.0) (2020-04-07) - - -### ⚠ BREAKING CHANGES - -* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. - -New feature: methods with pagination now support async iteration. - -### Features - -* drop node8 support, support for async iterators ([#388](https://www.github.com/googleapis/nodejs-tasks/issues/388)) ([2b759e1](https://www.github.com/googleapis/nodejs-tasks/commit/2b759e17adf636464fa67fbd99fe87a65cac317f)) - - -### Bug Fixes - -* export explicit version in protos.js ([#393](https://www.github.com/googleapis/nodejs-tasks/issues/393)) ([5b8c80d](https://www.github.com/googleapis/nodejs-tasks/commit/5b8c80d32f7c081887da203b833a2ee38ae69c38)) - -## [1.9.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.8.0...v1.9.0) (2020-03-06) - - -### Features - -* deferred client initialization ([#370](https://www.github.com/googleapis/nodejs-tasks/issues/370)) ([05fdd69](https://www.github.com/googleapis/nodejs-tasks/commit/05fdd6987c916da04c62193fe0f1081c23b85cbe)) - -## [1.8.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.7.3...v1.8.0) (2020-02-29) - - -### Features - -* add StackdriverLoggingConfig field to Cloud Tasks v2 API ([db2397a](https://www.github.com/googleapis/nodejs-tasks/commit/db2397a5efc59002a96a80a787ee2d405b1f4ce5)) -* export protos in src/index.ts ([a27e213](https://www.github.com/googleapis/nodejs-tasks/commit/a27e2135a359519ca7d17fae3f28718c42b5acf2)) - -### [1.7.3](https://www.github.com/googleapis/nodejs-tasks/compare/v1.7.2...v1.7.3) (2020-02-07) - - -### Bug Fixes - -* pass x-goog-request-params header for streaming calls ([ba267cc](https://www.github.com/googleapis/nodejs-tasks/commit/ba267ccc5c71cea747ec1fbdb9396a880fa2d902)) - -### [1.7.2](https://www.github.com/googleapis/nodejs-tasks/compare/v1.7.1...v1.7.2) (2020-01-28) - - -### Bug Fixes - -* enum, bytes, and Long types now accept strings ([58aa504](https://www.github.com/googleapis/nodejs-tasks/commit/58aa504d6d2076a0dc8c08d4c6b2b397f09cb3de)) - -### [1.7.1](https://www.github.com/googleapis/nodejs-tasks/compare/v1.7.0...v1.7.1) (2020-01-09) - - -### Bug Fixes - -* proper routing headers ([8a63747](https://www.github.com/googleapis/nodejs-tasks/commit/8a63747837341b10c3df4e5459387e4a8e7b02b5)) - -## [1.7.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.6.1...v1.7.0) (2020-01-05) - - -### Features - -* move library to typescript code generation ([#317](https://www.github.com/googleapis/nodejs-tasks/issues/317)) ([7dda287](https://www.github.com/googleapis/nodejs-tasks/commit/7dda2873c93295ccf19c6dc66daf4625cbe115bb)) - - -### Bug Fixes - -* **deps:** pin TypeScript below 3.7.0 ([124594b](https://www.github.com/googleapis/nodejs-tasks/commit/124594b3f00287c3a6f33c158aa4117dd03c52ca)) - -### [1.6.1](https://www.github.com/googleapis/nodejs-tasks/compare/v1.6.0...v1.6.1) (2019-11-18) - - -### Bug Fixes - -* **deps:** update dependency yargs to v15 ([#308](https://www.github.com/googleapis/nodejs-tasks/issues/308)) ([90d3a71](https://www.github.com/googleapis/nodejs-tasks/commit/90d3a71ab67648fed4aeec90178e2aceba45194d)) - -## [1.6.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.5.1...v1.6.0) (2019-11-13) - - -### Features - -* introduces HTTP targets to default v2 API ([#300](https://www.github.com/googleapis/nodejs-tasks/issues/300)) ([6dad421](https://www.github.com/googleapis/nodejs-tasks/commit/6dad4213f0b72e6ac1c708f98085037a48abe171)) - - -### Bug Fixes - -* **docs:** snippets are now replaced in jsdoc comments ([#304](https://www.github.com/googleapis/nodejs-tasks/issues/304)) ([741e8ab](https://www.github.com/googleapis/nodejs-tasks/commit/741e8ab46cb68d63c7fca0de526354432092d415)) -* import long into proto ts declaration file ([#305](https://www.github.com/googleapis/nodejs-tasks/issues/305)) ([dd1fcd1](https://www.github.com/googleapis/nodejs-tasks/commit/dd1fcd114c9ecd4d425c405b16036cf935be4e50)) - -### [1.5.1](https://www.github.com/googleapis/nodejs-tasks/compare/v1.5.0...v1.5.1) (2019-10-22) - - -### Bug Fixes - -* **deps:** bump google-gax to 1.7.5 ([#297](https://www.github.com/googleapis/nodejs-tasks/issues/297)) ([5f4fd9f](https://www.github.com/googleapis/nodejs-tasks/commit/5f4fd9f1de8c4e20836a099d8552b6c2139cc815)) - -## [1.5.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.4.0...v1.5.0) (2019-10-03) - - -### Bug Fixes - -* update paths in resource reference options ([#284](https://www.github.com/googleapis/nodejs-tasks/issues/284)) ([13b5db0](https://www.github.com/googleapis/nodejs-tasks/commit/13b5db0)) -* use compatible version of google-gax ([d6cae4e](https://www.github.com/googleapis/nodejs-tasks/commit/d6cae4e)) -* **docs:** use long names when class names collide ([#290](https://www.github.com/googleapis/nodejs-tasks/issues/290)) ([0215af8](https://www.github.com/googleapis/nodejs-tasks/commit/0215af8)) - - -### Features - -* .d.ts for protos ([#282](https://www.github.com/googleapis/nodejs-tasks/issues/282)) ([b15ba7d](https://www.github.com/googleapis/nodejs-tasks/commit/b15ba7d)) -* simplify Node sample ([#278](https://www.github.com/googleapis/nodejs-tasks/issues/278)) ([c6fa96d](https://www.github.com/googleapis/nodejs-tasks/commit/c6fa96d)) - -## [1.4.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.3.0...v1.4.0) (2019-09-16) - - -### Features - -* load protos from JSON, grpc-fallback support ([1c735c3](https://www.github.com/googleapis/nodejs-tasks/commit/1c735c3)) - -## [1.3.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.2.1...v1.3.0) (2019-08-28) - - -### Bug Fixes - -* **deps:** update dependency yargs to v14 ([d959ff7](https://www.github.com/googleapis/nodejs-tasks/commit/d959ff7)) -* **docs:** stop linking reference documents to anchor ([06f8c26](https://www.github.com/googleapis/nodejs-tasks/commit/06f8c26)) - - -### Features - -* switch to cloudtasks.googleapis.com default host ([#268](https://www.github.com/googleapis/nodejs-tasks/issues/268)) ([4f4c66b](https://www.github.com/googleapis/nodejs-tasks/commit/4f4c66b)) - -### [1.2.1](https://www.github.com/googleapis/nodejs-tasks/compare/v1.2.0...v1.2.1) (2019-08-05) - - -### Bug Fixes - -* allow calls with no request, add JSON proto ([01198ea](https://www.github.com/googleapis/nodejs-tasks/commit/01198ea)) - -## [1.2.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.1.2...v1.2.0) (2019-07-02) - - -### Features - -* add support for IAM policy options ([#255](https://www.github.com/googleapis/nodejs-tasks/issues/255)) ([7c7b0be](https://www.github.com/googleapis/nodejs-tasks/commit/7c7b0be)) - -### [1.1.2](https://www.github.com/googleapis/nodejs-tasks/compare/v1.1.1...v1.1.2) (2019-06-26) - - -### Bug Fixes - -* **docs:** link to reference docs section on googleapis.dev ([#250](https://www.github.com/googleapis/nodejs-tasks/issues/250)) ([a35d76c](https://www.github.com/googleapis/nodejs-tasks/commit/a35d76c)) - -### [1.1.1](https://www.github.com/googleapis/nodejs-tasks/compare/v1.1.0...v1.1.1) (2019-06-14) - - -### Bug Fixes - -* **docs:** move to new client docs URL ([#244](https://www.github.com/googleapis/nodejs-tasks/issues/244)) ([da8ddbc](https://www.github.com/googleapis/nodejs-tasks/commit/da8ddbc)) - -## [1.1.0](https://www.github.com/googleapis/nodejs-tasks/compare/v1.0.0...v1.1.0) (2019-06-05) - - -### Features - -* support apiEndpoint override in client constructor ([#239](https://www.github.com/googleapis/nodejs-tasks/issues/239)) ([5bb4eff](https://www.github.com/googleapis/nodejs-tasks/commit/5bb4eff)) - -## [1.0.0](https://www.github.com/googleapis/nodejs-tasks/compare/v0.5.0...v1.0.0) (2019-05-13) - - -### Bug Fixes - -* DEADLINE_EXCEEDED retry code is idempotent ([#219](https://www.github.com/googleapis/nodejs-tasks/issues/219)) ([59cfd36](https://www.github.com/googleapis/nodejs-tasks/commit/59cfd36)) -* **deps:** update dependency google-gax to v1 ([#218](https://www.github.com/googleapis/nodejs-tasks/issues/218)) ([25d0317](https://www.github.com/googleapis/nodejs-tasks/commit/25d0317)) -* DEADLINE_EXCEEDED no longer treated as idempotent and retried ([739a515](https://www.github.com/googleapis/nodejs-tasks/commit/739a515)) -* **deps:** update dependency google-gax to ^0.26.0 ([#207](https://www.github.com/googleapis/nodejs-tasks/issues/207)) ([7492ae3](https://www.github.com/googleapis/nodejs-tasks/commit/7492ae3)) - - -### Build System - -* upgrade engines field to >=8.10.0 ([#209](https://www.github.com/googleapis/nodejs-tasks/issues/209)) ([c2f4869](https://www.github.com/googleapis/nodejs-tasks/commit/c2f4869)) - - -### BREAKING CHANGES - -* upgrade engines field to >=8.10.0 (#209) - -## v0.5.0 - -03-21-2019 22:39 PDT - -**This release has breaking changes**. The default version of the API has changed from `v2beta3` to `v2`. Potential breaking changes may apply. - -### New Features -- feat: add v2 of the tasks API ([#192](https://github.com/googleapis/nodejs-tasks/pull/192)) - -### Internal / Testing Changes -- chore: publish to npm using wombat ([#189](https://github.com/googleapis/nodejs-tasks/pull/189)) -- build: use per-repo publish token ([#188](https://github.com/googleapis/nodejs-tasks/pull/188)) -- refactor: update json import paths ([#186](https://github.com/googleapis/nodejs-tasks/pull/186)) -- build: Add docuploader credentials to node publish jobs ([#184](https://github.com/googleapis/nodejs-tasks/pull/184)) - -## v0.4.0 - -03-06-2019 13:30 PST - -### New Features -- feat: add alpha support for HTTP triggers ([#177](https://github.com/googleapis/nodejs-tasks/pull/177)) - -### Bug fixes -- fix: throw on invalid credentials - -### Documentation -- docs: update contributing path in README ([#168](https://github.com/googleapis/nodejs-tasks/pull/168)) -- docs: move CONTRIBUTING.md to root ([#167](https://github.com/googleapis/nodejs-tasks/pull/167)) -- docs: add lint/fix example to contributing guide ([#165](https://github.com/googleapis/nodejs-tasks/pull/165)) -- docs: fix example comments ([#164](https://github.com/googleapis/nodejs-tasks/pull/164)) -- docs: update comments on protos ([#180](https://github.com/googleapis/nodejs-tasks/pull/180)) -- docs: sync latest proto docs -- docs: update README to include samples ([#178](https://github.com/googleapis/nodejs-tasks/pull/178)) -- docs: update links in contrib guide ([#174](https://github.com/googleapis/nodejs-tasks/pull/174)) - -### Internal / Testing Changes -- build: update release configuration -- chore(deps): update dependency mocha to v6 ([#176](https://github.com/googleapis/nodejs-tasks/pull/176)) -- build: use linkinator for docs test ([#173](https://github.com/googleapis/nodejs-tasks/pull/173)) -- fix(deps): update dependency yargs to v13 ([#171](https://github.com/googleapis/nodejs-tasks/pull/171)) -- build: create docs test npm scripts ([#170](https://github.com/googleapis/nodejs-tasks/pull/170)) -- build: test using @grpc/grpc-js in CI ([#169](https://github.com/googleapis/nodejs-tasks/pull/169)) -- refactor: improve generated code style. ([#163](https://github.com/googleapis/nodejs-tasks/pull/163)) - -## v0.3.0 - -01-31-2019 23:06 PST - -### Implementation Changes -- chore: adjust grpc timeout settings - -### New Features -- feat: support the .dispatch_deadline property. ([#160](https://github.com/googleapis/nodejs-tasks/pull/160)) - -### Dependencies -- fix(deps): update dependency google-gax to ^0.25.0 ([#161](https://github.com/googleapis/nodejs-tasks/pull/161)) -- fix(deps): update dependency google-gax to ^0.24.0 ([#158](https://github.com/googleapis/nodejs-tasks/pull/158)) -- fix(deps): update dependency google-gax to ^0.23.0 ([#154](https://github.com/googleapis/nodejs-tasks/pull/154)) -- fix(deps): update dependency google-gax to ^0.22.0 ([#122](https://github.com/googleapis/nodejs-tasks/pull/122)) - -### Documentation -- fix(docs): remove unused long running operations types -- samples: add queue create and delete samples ([#142](https://github.com/googleapis/nodejs-tasks/pull/142)) -- docs: update readme badges ([#133](https://github.com/googleapis/nodejs-tasks/pull/133)) -- docs(samples): updated samples code to use async await ([#129](https://github.com/googleapis/nodejs-tasks/pull/129)) -- update tasks samples to support new api version ([#83](https://github.com/googleapis/nodejs-tasks/pull/83)) - -### Internal / Testing Changes -- chore(deps): update dependency eslint-config-prettier to v4 ([#159](https://github.com/googleapis/nodejs-tasks/pull/159)) -- build: check broken links in generated docs ([#151](https://github.com/googleapis/nodejs-tasks/pull/151)) -- chore(build): inject yoshi automation key ([#149](https://github.com/googleapis/nodejs-tasks/pull/149)) -- chore: update nyc and eslint configs ([#148](https://github.com/googleapis/nodejs-tasks/pull/148)) -- chore: fix publish.sh permission +x ([#146](https://github.com/googleapis/nodejs-tasks/pull/146)) -- fix(build): fix Kokoro release script ([#145](https://github.com/googleapis/nodejs-tasks/pull/145)) -- build: add Kokoro configs for autorelease ([#144](https://github.com/googleapis/nodejs-tasks/pull/144)) -- chore: always nyc report before calling codecov ([#139](https://github.com/googleapis/nodejs-tasks/pull/139)) -- chore: nyc ignore build/test by default ([#138](https://github.com/googleapis/nodejs-tasks/pull/138)) -- chore: clean up usage of prettier and eslint ([#137](https://github.com/googleapis/nodejs-tasks/pull/137)) -- chore: update license file ([#135](https://github.com/googleapis/nodejs-tasks/pull/135)) -- fix(build): fix system key decryption ([#131](https://github.com/googleapis/nodejs-tasks/pull/131)) -- chore: add synth.metadata -- refactor(samples): convert sample tests from ava to mocha ([#126](https://github.com/googleapis/nodejs-tasks/pull/126)) -- chore: update eslintignore config ([#121](https://github.com/googleapis/nodejs-tasks/pull/121)) -- chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 ([#119](https://github.com/googleapis/nodejs-tasks/pull/119)) -- chore: drop contributors from multiple places ([#118](https://github.com/googleapis/nodejs-tasks/pull/118)) -- chore: use latest npm on Windows ([#117](https://github.com/googleapis/nodejs-tasks/pull/117)) -- chore: update CircleCI config ([#115](https://github.com/googleapis/nodejs-tasks/pull/115)) -- chore(deps): update dependency eslint-plugin-node to v8 ([#109](https://github.com/googleapis/nodejs-tasks/pull/109)) -- chore: update issue templates ([#108](https://github.com/googleapis/nodejs-tasks/pull/108)) -- chore: remove old issue template ([#104](https://github.com/googleapis/nodejs-tasks/pull/104)) -- build: run tests on node11 ([#103](https://github.com/googleapis/nodejs-tasks/pull/103)) -- chores(build): run codecov on continuous builds ([#99](https://github.com/googleapis/nodejs-tasks/pull/99)) -- chores(build): do not collect sponge.xml from windows builds ([#100](https://github.com/googleapis/nodejs-tasks/pull/100)) -- chore: update new issue template ([#98](https://github.com/googleapis/nodejs-tasks/pull/98)) -- chore(deps): update dependency sinon to v7 ([#93](https://github.com/googleapis/nodejs-tasks/pull/93)) -- build: fix codecov uploading on Kokoro ([#94](https://github.com/googleapis/nodejs-tasks/pull/94)) -- Update kokoro config ([#90](https://github.com/googleapis/nodejs-tasks/pull/90)) -- chore(deps): update dependency eslint-plugin-prettier to v3 ([#89](https://github.com/googleapis/nodejs-tasks/pull/89)) -- Update kokoro config ([#87](https://github.com/googleapis/nodejs-tasks/pull/87)) -- test: remove appveyor config ([#86](https://github.com/googleapis/nodejs-tasks/pull/86)) -- Update the CI config ([#85](https://github.com/googleapis/nodejs-tasks/pull/85)) -- Enable prefer-const in the eslint config ([#82](https://github.com/googleapis/nodejs-tasks/pull/82)) -- Enable no-var in eslint ([#81](https://github.com/googleapis/nodejs-tasks/pull/81)) -- chore(deps): update dependency sinon to v6.3.3 ([#79](https://github.com/googleapis/nodejs-tasks/pull/79)) -- Switch to let/const ([#80](https://github.com/googleapis/nodejs-tasks/pull/80)) - -## v0.2.2 - -### Implementation Changes -This patch release reverts back to using v2beta3 as the default version. It also updates the samples. -- feat: using v2beta3 by default - -### Documentation -- Update Cloud Tasks Sample ([#67](https://github.com/googleapis/nodejs-tasks/pull/67)) - -### Internal / Testing Changes -- fix: replace service account key with Tasks access ([#75](https://github.com/googleapis/nodejs-tasks/pull/75)) - -## v0.2.1 - -### Implementation Changes -Samples for v2beta3 is pending and they won't work for v2beta2. We're temporarily reverting back to defaulting to v2beta2 when you import the library like so: -``` -const cloudTasks = require('@google-cloud/tasks'); -const client = new cloudTasks.CloudTasksClient(); // v2beta2 by default -``` -- feat: restoring v2beta2 by default ([#71](https://github.com/googleapis/nodejs-tasks/pull/71)) - -### Dependencies -v0.20.0 fixes an issue with semver. -- bump google-gax 0.20.0 ([#69](https://github.com/googleapis/nodejs-tasks/pull/69)) - -### Documentation -- add namespace to fix some 404s in doc ([#66](https://github.com/googleapis/nodejs-tasks/pull/66)) - -### Internal / Testing Changes -- Update CI config ([#65](https://github.com/googleapis/nodejs-tasks/pull/65)) - -## v0.2.0 - -### New Features -- v2beta3 support for Node.js (#62) - -### Internal / Testing Changes -- Retry npm install in CI (#63) - -## v0.1.1 - -### Minor updates -- fix(deps): update dependency google-gax to ^0.19.0 (#49) -- fix(deps): update dependency google-gax to ^0.18.0 (#41) -- Re-generate library using /synth.py (#55) - -### Docs -- docs: update pull queue command (#30) -- docs: updated gcloud command (#29) -- Add Tasks Samples and Tests (#14) - -### Build & Test updates -- Update the CI config (#52) -- chore(deps): update dependency nyc to v13 (#53) -- chore: update CircleCI config -- chore(deps): update dependency eslint-config-prettier to v3 (#48) -- chore: do not use npm ci (#47) -- chore: ignore package-lock.json (#45) -- chore: update renovate config (#43) -- remove that whitespace (#42) -- chore(deps): lock file maintenance (#40) -- chore: move mocha options to mocha.opts (#39) -- Re-generate library using /synth.py (#38) -- Re-generate library using /synth.py (#35) -- chore: add node templates to synth.py (#36) -- fix: samples to require node>=8 (#37) -- chore(deps): lock file maintenance (#34) -- chore(deps): update dependency eslint-plugin-node to v7 (#32) -- test: use strictEqual in tests (#33) -- chore(deps): lock file maintenance (#31) -- Upgrade repo-tools and regenerate scaffolding. (#27) -- chore(deps): lock file maintenance (#25) -- chore(deps): lock file maintenance (#24) -- chore(deps): lock file maintenance (#23) -- fix(deps): update dependency yargs to v12 (#22) -- fix: update dependencies, run synth (#20) -- Configure Renovate (#15) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 2add2547..46b2a08e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,94 +1,43 @@ - -# Code of Conduct +# Contributor Code of Conduct -## Our Pledge +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. -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 +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. 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. +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. 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 +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d531860..78aaa61b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,18 +34,8 @@ accept your pull requests. 1. Ensure that your code adheres to the existing style in the code to which you are contributing. 1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Cloud Tasks 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]. @@ -56,21 +46,10 @@ accept your pull requests. 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=tasks.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/linkinator.config.json b/linkinator.config.json deleted file mode 100644 index befd23c8..00000000 --- a/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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/owlbot.py b/owlbot.py deleted file mode 100644 index 49fce7a6..00000000 --- a/owlbot.py +++ /dev/null @@ -1,17 +0,0 @@ -# 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. -import synthtool.languages.node as node -node.owlbot_main(templates_excludes=[ -'README.md' -]) diff --git a/package.json b/package.json deleted file mode 100644 index a20287d6..00000000 --- a/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "@google-cloud/tasks", - "description": "Cloud Tasks API client for Node.js", - "version": "3.0.5", - "license": "Apache-2.0", - "author": "Google LLC", - "engines": { - "node": ">=12.0.0" - }, - "repository": "googleapis/nodejs-tasks", - "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 cloud-tasks", - "cloud-tasks", - "Cloud Tasks 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", - "docs-test": "linkinator docs", - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "predocs-test": "npm run docs", - "prepare": "npm run compile", - "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" - }, - "dependencies": { - "google-gax": "^3.5.2" - }, - "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^18.0.0", - "@types/sinon": "^10.0.0", - "c8": "^7.0.0", - "codecov": "^3.0.2", - "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/protos/google/cloud/common_resources.proto b/protos/google/cloud/common_resources.proto deleted file mode 100644 index 56c9f800..00000000 --- a/protos/google/cloud/common_resources.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file contains stub messages for common resources in GCP. -// It is not intended to be directly generated, and is instead used by -// other tooling to be able to match common resource patterns. -syntax = "proto3"; - -package google.cloud; - -import "google/api/resource.proto"; - - -option (google.api.resource_definition) = { - type: "cloudresourcemanager.googleapis.com/Project" - pattern: "projects/{project}" -}; - - -option (google.api.resource_definition) = { - type: "cloudresourcemanager.googleapis.com/Organization" - pattern: "organizations/{organization}" -}; - - -option (google.api.resource_definition) = { - type: "cloudresourcemanager.googleapis.com/Folder" - pattern: "folders/{folder}" -}; - - -option (google.api.resource_definition) = { - type: "cloudbilling.googleapis.com/BillingAccount" - pattern: "billingAccounts/{billing_account}" -}; - -option (google.api.resource_definition) = { - type: "locations.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" -}; - diff --git a/protos/google/cloud/tasks/v2/cloudtasks.proto b/protos/google/cloud/tasks/v2/cloudtasks.proto deleted file mode 100644 index d30aae51..00000000 --- a/protos/google/cloud/tasks/v2/cloudtasks.proto +++ /dev/null @@ -1,655 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.tasks.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/tasks/v2/queue.proto"; -import "google/cloud/tasks/v2/task.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "CloudTasksProto"; -option java_package = "com.google.cloud.tasks.v2"; -option objc_class_prefix = "TASKS"; - -// Cloud Tasks allows developers to manage the execution of background -// work in their applications. -service CloudTasks { - option (google.api.default_host) = "cloudtasks.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists queues. - // - // Queues are returned in lexicographical order. - rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*}/queues" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a queue. - rpc GetQueue(GetQueueRequest) returns (Queue) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/queues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a queue. - // - // Queues created with this method allow tasks to live for a maximum of 31 - // days. After a task is 31 days old, the task will be deleted regardless of whether - // it was dispatched or not. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc CreateQueue(CreateQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*}/queues" - body: "queue" - }; - option (google.api.method_signature) = "parent,queue"; - } - - // Updates a queue. - // - // This method creates the queue if it does not exist and updates - // the queue if it does exist. - // - // Queues created with this method allow tasks to live for a maximum of 31 - // days. After a task is 31 days old, the task will be deleted regardless of whether - // it was dispatched or not. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc UpdateQueue(UpdateQueueRequest) returns (Queue) { - option (google.api.http) = { - patch: "/v2/{queue.name=projects/*/locations/*/queues/*}" - body: "queue" - }; - option (google.api.method_signature) = "queue,update_mask"; - } - - // Deletes a queue. - // - // This command will delete the queue even if it has tasks in it. - // - // Note: If you delete a queue, a queue with the same name can't be created - // for 7 days. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc DeleteQueue(DeleteQueueRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/queues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Purges a queue by deleting all of its tasks. - // - // All tasks created before this method is called are permanently deleted. - // - // Purge operations can take up to one minute to take effect. Tasks - // might be dispatched before the purge takes effect. A purge is irreversible. - rpc PurgeQueue(PurgeQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/queues/*}:purge" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Pauses the queue. - // - // If a queue is paused then the system will stop dispatching tasks - // until the queue is resumed via - // [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can still be added - // when the queue is paused. A queue is paused if its - // [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - rpc PauseQueue(PauseQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/queues/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resume a queue. - // - // This method resumes a queue after it has been - // [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or - // [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a queue is stored - // in the queue's [state][google.cloud.tasks.v2.Queue.state]; after calling this method it - // will be set to [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. - // - // WARNING: Resuming many high-QPS queues at the same time can - // lead to target overloading. If you are resuming high-QPS - // queues, follow the 500/50/5 pattern described in - // [Managing Cloud Tasks Scaling - // Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - rpc ResumeQueue(ResumeQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/queues/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. - // Returns an empty policy if the resource exists and does not have a policy - // set. - // - // Authorization requires the following - // [Google IAM](https://cloud.google.com/iam) permission on the specified - // resource parent: - // - // * `cloudtasks.queues.getIamPolicy` - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. Replaces any existing - // policy. - // - // Note: The Cloud Console does not check queue-level IAM permissions yet. - // Project-level permissions are required to use the Cloud Console. - // - // Authorization requires the following - // [Google IAM](https://cloud.google.com/iam) permission on the specified - // resource parent: - // - // * `cloudtasks.queues.setIamPolicy` - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2.Queue]. - // If the resource does not exist, this will return an empty set of - // permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - // - // Note: This operation is designed to be used for building permission-aware - // UIs and command-line tools, not for authorization checking. This operation - // may "fail open" without warning. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Lists the tasks in a queue. - // - // By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is retrieved - // due to performance considerations; - // [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] controls the - // subset of information which is returned. - // - // The tasks may be returned in any order. The ordering may change at any - // time. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/locations/*/queues/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v2/{name=projects/*/locations/*/queues/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a task and adds it to a queue. - // - // Tasks cannot be updated after creation; there is no UpdateTask command. - // - // * The maximum task size is 100KB. - rpc CreateTask(CreateTaskRequest) returns (Task) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/locations/*/queues/*}/tasks" - body: "*" - }; - option (google.api.method_signature) = "parent,task"; - } - - // Deletes a task. - // - // A task can be deleted if it is scheduled or dispatched. A task - // cannot be deleted if it has executed successfully or permanently - // failed. - rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/locations/*/queues/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Forces a task to run now. - // - // When this method is called, Cloud Tasks will dispatch the task, even if - // the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2.RateLimits] or - // is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - // - // This command is meant to be used for manual debugging. For - // example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to retry a failed - // task after a fix has been made or to manually force a task to be - // dispatched now. - // - // The dispatched task is returned. That is, the task that is returned - // contains the [status][Task.status] after the task is dispatched but - // before the task is received by its target. - // - // If Cloud Tasks receives a successful response from the task's - // target, then the task will be deleted; otherwise the task's - // [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to the time that - // [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was called plus the retry delay specified - // in the queue's [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - // - // [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns - // [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - // task that has already succeeded or permanently failed. - rpc RunTask(RunTaskRequest) returns (Task) { - option (google.api.http) = { - post: "/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]. -message ListQueuesRequest { - // Required. The location name. - // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2.Queue] - // field can be used as a filter and several operators as supported. - // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - // described in - // [Stackdriver's Advanced Logs - // Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - // - // Sample filter "state: PAUSED". - // - // Note that using filters might cause fewer queues than the - // requested page_size to be returned. - string filter = 2; - - // Requested page size. - // - // The maximum page size is 9800. If unspecified, the page size will - // be the maximum. Fewer queues than requested might be returned, - // even if more queues exist; use the - // [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] in the - // response to determine if more queues exist. - int32 page_size = 3; - - // A token identifying the page of results to return. - // - // To request the first page results, page_token must be empty. To - // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.tasks.v2.ListQueuesResponse.next_page_token] returned - // from the previous call to [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] - // method. It is an error to switch the value of the - // [filter][google.cloud.tasks.v2.ListQueuesRequest.filter] while iterating through pages. - string page_token = 4; -} - -// Response message for [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]. -message ListQueuesResponse { - // The list of queues. - repeated Queue queues = 1; - - // A token to retrieve next page of results. - // - // To return the next page of results, call - // [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues] with this value as the - // [page_token][google.cloud.tasks.v2.ListQueuesRequest.page_token]. - // - // If the next_page_token is empty, there are no more results. - // - // The page token is valid for only 2 hours. - string next_page_token = 2; -} - -// Request message for [GetQueue][google.cloud.tasks.v2.CloudTasks.GetQueue]. -message GetQueueRequest { - // Required. The resource name of the queue. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue]. -message CreateQueueRequest { - // Required. The location name in which the queue will be created. - // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - // - // The list of allowed locations can be obtained by calling Cloud - // Tasks' implementation of - // [ListLocations][google.cloud.location.Locations.ListLocations]. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // Required. The queue to create. - // - // [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue. - Queue queue = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue]. -message UpdateQueueRequest { - // Required. The queue to create or update. - // - // The queue's [name][google.cloud.tasks.v2.Queue.name] must be specified. - // - // Output only fields cannot be modified using UpdateQueue. - // Any value specified for an output only field will be ignored. - // The queue's [name][google.cloud.tasks.v2.Queue.name] cannot be changed. - Queue queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // A mask used to specify which fields of the queue are being updated. - // - // If empty, then all fields will be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue]. -message DeleteQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue]. -message PurgeQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue]. -message PauseQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. -message ResumeQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for listing tasks using [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]. -message ListTasksRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2.Task] resource. - Task.View response_view = 2; - - // Maximum page size. - // - // Fewer tasks than requested might be returned, even if more tasks exist; use - // [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] in the response to - // determine if more tasks exist. - // - // The maximum page size is 1000. If unspecified, the page size will be the - // maximum. - int32 page_size = 3; - - // A token identifying the page of results to return. - // - // To request the first page results, page_token must be empty. To - // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.tasks.v2.ListTasksResponse.next_page_token] returned - // from the previous call to [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] - // method. - // - // The page token is valid for only 2 hours. - string page_token = 4; -} - -// Response message for listing tasks using [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]. -message ListTasksResponse { - // The list of tasks. - repeated Task tasks = 1; - - // A token to retrieve next page of results. - // - // To return the next page of results, call - // [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks] with this value as the - // [page_token][google.cloud.tasks.v2.ListTasksRequest.page_token]. - // - // If the next_page_token is empty, there are no more results. - string next_page_token = 2; -} - -// Request message for getting a task using [GetTask][google.cloud.tasks.v2.CloudTasks.GetTask]. -message GetTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2.Task] resource. - Task.View response_view = 2; -} - -// Request message for [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. -message CreateTaskRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - // - // The queue must already exist. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // Required. The task to add. - // - // Task names have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - // The user can optionally specify a task [name][google.cloud.tasks.v2.Task.name]. If a - // name is not specified then the system will generate a random - // unique task id, which will be set in the task returned in the - // [response][google.cloud.tasks.v2.Task.name]. - // - // If [schedule_time][google.cloud.tasks.v2.Task.schedule_time] is not set or is in the - // past then Cloud Tasks will set it to the current time. - // - // Task De-duplication: - // - // Explicitly specifying a task ID enables task de-duplication. If - // a task's ID is identical to that of an existing task or a task - // that was deleted or executed recently then the call will fail - // with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - // If the task's queue was created using Cloud Tasks, then another task with - // the same name can't be created for ~1hour after the original task was - // deleted or executed. If the task's queue was created using queue.yaml or - // queue.xml, then another task with the same name can't be created - // for ~9days after the original task was deleted or executed. - // - // Because there is an extra lookup cost to identify duplicate task - // names, these [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] calls have significantly - // increased latency. Using hashed strings for the task id or for - // the prefix of the task id is recommended. Choosing task ids that - // are sequential or have sequential prefixes, for example using a - // timestamp, causes an increase in latency and error rates in all - // task commands. The infrastructure relies on an approximately - // uniform distribution of task ids to store and serve tasks - // efficiently. - Task task = 2 [(google.api.field_behavior) = REQUIRED]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2.Task] resource. - Task.View response_view = 3; -} - -// Request message for deleting a task using -// [DeleteTask][google.cloud.tasks.v2.CloudTasks.DeleteTask]. -message DeleteTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; -} - -// Request message for forcing a task to run now using -// [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask]. -message RunTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2.Task] resource. - Task.View response_view = 2; -} diff --git a/protos/google/cloud/tasks/v2/queue.proto b/protos/google/cloud/tasks/v2/queue.proto deleted file mode 100644 index 3de39792..00000000 --- a/protos/google/cloud/tasks/v2/queue.proto +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.tasks.v2; - -import "google/api/resource.proto"; -import "google/cloud/tasks/v2/target.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "QueueProto"; -option java_package = "com.google.cloud.tasks.v2"; - -// A queue is a container of related tasks. Queues are configured to manage -// how those tasks are dispatched. Configurable properties include rate limits, -// retry options, queue types, and others. -message Queue { - option (google.api.resource) = { - type: "cloudtasks.googleapis.com/Queue" - pattern: "projects/{project}/locations/{location}/queues/{queue}" - }; - - // State of the queue. - enum State { - // Unspecified state. - STATE_UNSPECIFIED = 0; - - // The queue is running. Tasks can be dispatched. - // - // If the queue was created using Cloud Tasks and the queue has - // had no activity (method calls or task dispatches) for 30 days, - // the queue may take a few minutes to re-activate. Some method - // calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - // tasks may not be dispatched for a few minutes until the queue - // has been re-activated. - RUNNING = 1; - - // Tasks are paused by the user. If the queue is paused then Cloud - // Tasks will stop delivering tasks from it, but more tasks can - // still be added to it by the user. - PAUSED = 2; - - // The queue is disabled. - // - // A queue becomes `DISABLED` when - // [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - // or - // [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - // is uploaded which does not contain the queue. You cannot directly disable - // a queue. - // - // When a queue is disabled, tasks can still be added to a queue - // but the tasks are not dispatched. - // - // To permanently delete this queue and all of its tasks, call - // [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue]. - DISABLED = 3; - } - - // Caller-specified and required in [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue], - // after which it becomes output only. - // - // The queue name. - // - // The queue name must have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - // - // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), colons (:), or periods (.). - // For more information, see - // [Identifying - // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - // * `LOCATION_ID` is the canonical ID for the queue's location. - // The list of available locations can be obtained by calling - // [ListLocations][google.cloud.location.Locations.ListLocations]. - // For more information, see https://cloud.google.com/about/locations/. - // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - // hyphens (-). The maximum length is 100 characters. - string name = 1; - - // Overrides for - // [task-level app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - // These settings apply only to - // [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in this queue. - // [Http tasks][google.cloud.tasks.v2.HttpRequest] are not affected. - // - // If set, `app_engine_routing_override` is used for all - // [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest] in the queue, no matter what the - // setting is for the - // [task-level app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing]. - AppEngineRouting app_engine_routing_override = 2; - - // Rate limits for task dispatches. - // - // [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] and [retry_config][google.cloud.tasks.v2.Queue.retry_config] are - // related because they both control task attempts. However they control task - // attempts in different ways: - // - // * [rate_limits][google.cloud.tasks.v2.Queue.rate_limits] controls the total rate of - // dispatches from a queue (i.e. all traffic dispatched from the - // queue, regardless of whether the dispatch is from a first - // attempt or a retry). - // * [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls what happens to - // particular a task after its first attempt fails. That is, - // [retry_config][google.cloud.tasks.v2.Queue.retry_config] controls task retries (the - // second attempt, third attempt, etc). - // - // The queue's actual dispatch rate is the result of: - // - // * Number of tasks in the queue - // * User-specified throttling: [rate_limits][google.cloud.tasks.v2.Queue.rate_limits], - // [retry_config][google.cloud.tasks.v2.Queue.retry_config], and the - // [queue's state][google.cloud.tasks.v2.Queue.state]. - // * System throttling due to `429` (Too Many Requests) or `503` (Service - // Unavailable) responses from the worker, high error rates, or to smooth - // sudden large traffic spikes. - RateLimits rate_limits = 3; - - // Settings that determine the retry behavior. - // - // * For tasks created using Cloud Tasks: the queue-level retry settings - // apply to all tasks in the queue that were created using Cloud Tasks. - // Retry settings cannot be set on individual tasks. - // * For tasks created using the App Engine SDK: the queue-level retry - // settings apply to all tasks in the queue which do not have retry settings - // explicitly set on the task and were created by the App Engine SDK. See - // [App Engine - // documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - RetryConfig retry_config = 4; - - // Output only. The state of the queue. - // - // `state` can only be changed by called - // [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue], - // [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading - // [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - // [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] cannot be used to change `state`. - State state = 5; - - // Output only. The last time this queue was purged. - // - // All tasks that were [created][google.cloud.tasks.v2.Task.create_time] before this time - // were purged. - // - // A queue can be purged using [PurgeQueue][google.cloud.tasks.v2.CloudTasks.PurgeQueue], the - // [App Engine Task Queue SDK, or the Cloud - // Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - // - // Purge time will be truncated to the nearest microsecond. Purge - // time will be unset if the queue has never been purged. - google.protobuf.Timestamp purge_time = 6; - - // Configuration options for writing logs to - // [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - // field is unset, then no logs are written. - StackdriverLoggingConfig stackdriver_logging_config = 9; -} - -// Rate limits. -// -// This message determines the maximum rate that tasks can be dispatched by a -// queue, regardless of whether the dispatch is a first task attempt or a retry. -// -// Note: The debugging command, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask], will run a task -// even if the queue has reached its [RateLimits][google.cloud.tasks.v2.RateLimits]. -message RateLimits { - // The maximum rate at which tasks are dispatched from this queue. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // * The maximum allowed value is 500. - // - // - // This field has the same meaning as - // [rate in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - double max_dispatches_per_second = 1; - - // Output only. The max burst size. - // - // Max burst size limits how fast tasks in queue are processed when - // many tasks are in the queue and the rate is high. This field - // allows the queue to have a high rate so processing starts shortly - // after a task is enqueued, but still limits resource usage when - // many tasks are enqueued in a short period of time. - // - // The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - // algorithm is used to control the rate of task dispatches. Each - // queue has a token bucket that holds tokens, up to the maximum - // specified by `max_burst_size`. Each time a task is dispatched, a - // token is removed from the bucket. Tasks will be dispatched until - // the queue's bucket runs out of tokens. The bucket will be - // continuously refilled with new tokens based on - // [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - // - // Cloud Tasks will pick the value of `max_burst_size` based on the - // value of - // [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. - // - // For queues that were created or updated using - // `queue.yaml/xml`, `max_burst_size` is equal to - // [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - // Since `max_burst_size` is output only, if - // [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a queue - // created by `queue.yaml/xml`, `max_burst_size` will be reset based - // on the value of - // [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], - // regardless of whether - // [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] - // is updated. - // - int32 max_burst_size = 2; - - // The maximum number of concurrent tasks that Cloud Tasks allows - // to be dispatched for this queue. After this threshold has been - // reached, Cloud Tasks stops dispatching tasks until the number of - // concurrent requests decreases. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // The maximum allowed value is 5,000. - // - // - // This field has the same meaning as - // [max_concurrent_requests in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - int32 max_concurrent_dispatches = 3; -} - -// Retry config. -// -// These settings determine when a failed task attempt is retried. -message RetryConfig { - // Number of attempts per task. - // - // Cloud Tasks will attempt the task `max_attempts` times (that is, if the - // first attempt fails, then there will be `max_attempts - 1` retries). Must - // be >= -1. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // -1 indicates unlimited attempts. - // - // This field has the same meaning as - // [task_retry_limit in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - int32 max_attempts = 1; - - // If positive, `max_retry_duration` specifies the time limit for - // retrying a failed task, measured from when the task was first - // attempted. Once `max_retry_duration` time has passed *and* the - // task has been attempted [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] - // times, no further attempts will be made and the task will be - // deleted. - // - // If zero, then the task age is unlimited. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // `max_retry_duration` will be truncated to the nearest second. - // - // This field has the same meaning as - // [task_age_limit in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration max_retry_duration = 2; - - // A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for retry between - // [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] and - // [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration after it fails, - // if the queue's [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task should be - // retried. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // `min_backoff` will be truncated to the nearest second. - // - // This field has the same meaning as - // [min_backoff_seconds in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration min_backoff = 3; - - // A task will be [scheduled][google.cloud.tasks.v2.Task.schedule_time] for retry between - // [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] and - // [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] duration after it fails, - // if the queue's [RetryConfig][google.cloud.tasks.v2.RetryConfig] specifies that the task should be - // retried. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // `max_backoff` will be truncated to the nearest second. - // - // This field has the same meaning as - // [max_backoff_seconds in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration max_backoff = 4; - - // The time between retries will double `max_doublings` times. - // - // A task's retry interval starts at - // [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles - // `max_doublings` times, then increases linearly, and finally - // retries retries at intervals of - // [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to - // [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times. - // - // For example, if [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff] is 10s, - // [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] is 300s, and - // `max_doublings` is 3, then the a task will first be retried in - // 10s. The retry interval will double three times, and then - // increase linearly by 2^3 * 10s. Finally, the task will retry at - // intervals of [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] until the - // task has been attempted [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] - // times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, - // 240s, 300s, 300s, .... - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // This field has the same meaning as - // [max_doublings in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - int32 max_doublings = 5; -} - -// Configuration options for writing logs to -// [Stackdriver Logging](https://cloud.google.com/logging/docs/). -message StackdriverLoggingConfig { - // Specifies the fraction of operations to write to - // [Stackdriver Logging](https://cloud.google.com/logging/docs/). - // This field may contain any value between 0.0 and 1.0, inclusive. - // 0.0 is the default and means that no operations are logged. - double sampling_ratio = 1; -} diff --git a/protos/google/cloud/tasks/v2/target.proto b/protos/google/cloud/tasks/v2/target.proto deleted file mode 100644 index db7ef20f..00000000 --- a/protos/google/cloud/tasks/v2/target.proto +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.tasks.v2; - -import "google/api/field_behavior.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "TargetProto"; -option java_package = "com.google.cloud.tasks.v2"; - -// HTTP request. -// -// The task will be pushed to the worker as an HTTP request. If the worker -// or the redirected worker acknowledges the task by returning a successful HTTP -// response code ([`200` - `299`]), the task will be removed from the queue. If -// any other HTTP response code is returned or no response is received, the -// task will be retried according to the following: -// -// * User-specified throttling: [retry configuration][google.cloud.tasks.v2.Queue.retry_config], -// [rate limits][google.cloud.tasks.v2.Queue.rate_limits], and the [queue's state][google.cloud.tasks.v2.Queue.state]. -// -// * System throttling: To prevent the worker from overloading, Cloud Tasks may -// temporarily reduce the queue's effective rate. User-specified settings -// will not be changed. -// -// System throttling happens because: -// -// * Cloud Tasks backs off on all errors. Normally the backoff specified in -// [rate limits][google.cloud.tasks.v2.Queue.rate_limits] will be used. But if the worker returns -// `429` (Too Many Requests), `503` (Service Unavailable), or the rate of -// errors is high, Cloud Tasks will use a higher backoff rate. The retry -// specified in the `Retry-After` HTTP response header is considered. -// -// * To prevent traffic spikes and to smooth sudden increases in traffic, -// dispatches ramp up slowly when the queue is newly created or idle and -// if large numbers of tasks suddenly become available to dispatch (due to -// spikes in create task rates, the queue being unpaused, or many tasks -// that are scheduled at the same time). -message HttpRequest { - // Required. The full url path that the request will be sent to. - // - // This string must begin with either "http://" or "https://". Some examples - // are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - // encode some characters for safety and compatibility. The maximum allowed - // URL length is 2083 characters after encoding. - // - // The `Location` header response from a redirect response [`300` - `399`] - // may be followed. The redirect is not counted as a separate attempt. - string url = 1 [(google.api.field_behavior) = REQUIRED]; - - // The HTTP method to use for the request. The default is POST. - HttpMethod http_method = 2; - - // HTTP request headers. - // - // This map contains the header field names and values. - // Headers can be set when the - // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // - // These headers represent a subset of the headers that will accompany the - // task's HTTP request. Some HTTP request headers will be ignored or replaced. - // - // A partial list of headers that will be ignored or replaced is: - // - // * Host: This will be computed by Cloud Tasks and derived from - // [HttpRequest.url][google.cloud.tasks.v2.HttpRequest.url]. - // * Content-Length: This will be computed by Cloud Tasks. - // * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - // * `X-Google-*`: Google use only. - // * `X-AppEngine-*`: Google use only. - // - // `Content-Type` won't be set by Cloud Tasks. You can explicitly set - // `Content-Type` to a media type when the - // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // For example, `Content-Type` can be set to `"application/octet-stream"` or - // `"application/json"`. - // - // Headers which can have multiple values (according to RFC2616) can be - // specified using comma-separated values. - // - // The size of the headers must be less than 80KB. - map headers = 3; - - // HTTP request body. - // - // A request body is allowed only if the - // [HTTP method][google.cloud.tasks.v2.HttpRequest.http_method] is POST, PUT, or PATCH. It is an - // error to set body on a task with an incompatible [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - bytes body = 4; - - // The mode for generating an `Authorization` header for HTTP requests. - // - // If specified, all `Authorization` headers in the [HttpRequest.headers][google.cloud.tasks.v2.HttpRequest.headers] - // field will be overridden. - oneof authorization_header { - // If specified, an - // [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - // will be generated and attached as an `Authorization` header in the HTTP - // request. - // - // This type of authorization should generally only be used when calling - // Google APIs hosted on *.googleapis.com. - OAuthToken oauth_token = 5; - - // If specified, an - // [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - // token will be generated and attached as an `Authorization` header in the - // HTTP request. - // - // This type of authorization can be used for many scenarios, including - // calling Cloud Run, or endpoints where you intend to validate the token - // yourself. - OidcToken oidc_token = 6; - } -} - -// App Engine HTTP request. -// -// The message defines the HTTP request that is sent to an App Engine app when -// the task is dispatched. -// -// Using [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] requires -// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -// Google IAM permission for the project -// and the following scope: -// -// `https://www.googleapis.com/auth/cloud-platform` -// -// The task will be delivered to the App Engine app which belongs to the same -// project as the queue. For more information, see -// [How Requests are -// Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) -// and how routing is affected by -// [dispatch -// files](https://cloud.google.com/appengine/docs/python/config/dispatchref). -// Traffic is encrypted during transport and never leaves Google datacenters. -// Because this traffic is carried over a communication mechanism internal to -// Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). -// The request to the handler, however, will appear to have used the HTTP -// protocol. -// -// The [AppEngineRouting][google.cloud.tasks.v2.AppEngineRouting] used to construct the URL that the task is -// delivered to can be set at the queue-level or task-level: -// -// * If [app_engine_routing_override is set on the -// queue][Queue.app_engine_routing_override], this value is used for all -// tasks in the queue, no matter what the setting is for the [task-level -// app_engine_routing][AppEngineHttpRequest.app_engine_routing]. -// -// -// The `url` that the task will be sent to is: -// -// * `url =` [host][google.cloud.tasks.v2.AppEngineRouting.host] `+` -// [relative_uri][google.cloud.tasks.v2.AppEngineHttpRequest.relative_uri] -// -// Tasks can be dispatched to secure app handlers, unsecure app handlers, and -// URIs restricted with -// [`login: -// admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). -// Because tasks are not run as any user, they cannot be dispatched to URIs -// restricted with -// [`login: -// required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) -// Task dispatches also do not follow redirects. -// -// The task attempt has succeeded if the app's request handler returns an HTTP -// response code in the range [`200` - `299`]. The task attempt has failed if -// the app's handler returns a non-2xx response code or Cloud Tasks does -// not receive response before the [deadline][google.cloud.tasks.v2.Task.dispatch_deadline]. Failed -// tasks will be retried according to the -// [retry configuration][google.cloud.tasks.v2.Queue.retry_config]. `503` (Service Unavailable) is -// considered an App Engine system error instead of an application error and -// will cause Cloud Tasks' traffic congestion control to temporarily throttle -// the queue's dispatches. Unlike other types of task targets, a `429` (Too Many -// Requests) response from an app handler does not cause traffic congestion -// control to throttle the queue. -message AppEngineHttpRequest { - // The HTTP method to use for the request. The default is POST. - // - // The app's request handler for the task's target URL must be able to handle - // HTTP requests with this http_method, otherwise the task attempt will fail - // with error code 405 (Method Not Allowed). See - // [Writing a push task request - // handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - // and the documentation for the request handlers in the language your app is - // written in e.g. - // [Python Request - // Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). - HttpMethod http_method = 1; - - // Task-level setting for App Engine routing. - // - // * If [app_engine_routing_override is set on the - // queue][Queue.app_engine_routing_override], this value is used for all - // tasks in the queue, no matter what the setting is for the [task-level - // app_engine_routing][AppEngineHttpRequest.app_engine_routing]. - AppEngineRouting app_engine_routing = 2; - - // The relative URI. - // - // The relative URI must begin with "/" and must be a valid HTTP relative URI. - // It can contain a path and query string arguments. - // If the relative URI is empty, then the root path "/" will be used. - // No spaces are allowed, and the maximum length allowed is 2083 characters. - string relative_uri = 3; - - // HTTP request headers. - // - // This map contains the header field names and values. - // Headers can be set when the - // [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - // Repeated headers are not supported but a header value can contain commas. - // - // Cloud Tasks sets some headers to default values: - // - // * `User-Agent`: By default, this header is - // `"AppEngine-Google; (+http://code.google.com/appengine)"`. - // This header can be modified, but Cloud Tasks will append - // `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - // modified `User-Agent`. - // - // If the task has a [body][google.cloud.tasks.v2.AppEngineHttpRequest.body], Cloud - // Tasks sets the following headers: - // - // * `Content-Type`: By default, the `Content-Type` header is set to - // `"application/octet-stream"`. The default can be overridden by explicitly - // setting `Content-Type` to a particular media type when the - // [task is created][google.cloud.tasks.v2.CloudTasks.CreateTask]. - // For example, `Content-Type` can be set to `"application/json"`. - // * `Content-Length`: This is computed by Cloud Tasks. This value is - // output only. It cannot be changed. - // - // The headers below cannot be set or overridden: - // - // * `Host` - // * `X-Google-*` - // * `X-AppEngine-*` - // - // In addition, Cloud Tasks sets some headers when the task is dispatched, - // such as headers containing information about the task; see - // [request - // headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - // These headers are set only when the task is dispatched, so they are not - // visible when the task is returned in a Cloud Tasks response. - // - // Although there is no specific limit for the maximum number of headers or - // the size, there is a limit on the maximum size of the [Task][google.cloud.tasks.v2.Task]. For more - // information, see the [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask] documentation. - map headers = 4; - - // HTTP request body. - // - // A request body is allowed only if the HTTP method is POST or PUT. It is - // an error to set a body on a task with an incompatible [HttpMethod][google.cloud.tasks.v2.HttpMethod]. - bytes body = 5; -} - -// App Engine Routing. -// -// Defines routing characteristics specific to App Engine - service, version, -// and instance. -// -// For more information about services, versions, and instances see -// [An Overview of App -// Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), -// [Microservices Architecture on Google App -// Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), -// [App Engine Standard request -// routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), -// and [App Engine Flex request -// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). -// -// Using [AppEngineRouting][google.cloud.tasks.v2.AppEngineRouting] requires -// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -// Google IAM permission for the project -// and the following scope: -// -// `https://www.googleapis.com/auth/cloud-platform` -message AppEngineRouting { - // App service. - // - // By default, the task is sent to the service which is the default - // service when the task is attempted. - // - // For some queues or tasks which were created using the App Engine - // Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable - // into [service][google.cloud.tasks.v2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, some tasks - // which were created using the App Engine SDK use a custom domain - // name; custom domains are not parsed by Cloud Tasks. If - // [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - // [service][google.cloud.tasks.v2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty string. - string service = 1; - - // App version. - // - // By default, the task is sent to the version which is the default - // version when the task is attempted. - // - // For some queues or tasks which were created using the App Engine - // Task Queue API, [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable - // into [service][google.cloud.tasks.v2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. For example, some tasks - // which were created using the App Engine SDK use a custom domain - // name; custom domains are not parsed by Cloud Tasks. If - // [host][google.cloud.tasks.v2.AppEngineRouting.host] is not parsable, then - // [service][google.cloud.tasks.v2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2.AppEngineRouting.instance] are the empty string. - string version = 2; - - // App instance. - // - // By default, the task is sent to an instance which is available when - // the task is attempted. - // - // Requests can only be sent to a specific instance if - // [manual scaling is used in App Engine - // Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - // App Engine Flex does not support instances. For more information, see - // [App Engine Standard request - // routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - // and [App Engine Flex request - // routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - string instance = 3; - - // Output only. The host that the task is sent to. - // - // The host is constructed from the domain name of the app associated with - // the queue's project ID (for example .appspot.com), and the - // [service][google.cloud.tasks.v2.AppEngineRouting.service], [version][google.cloud.tasks.v2.AppEngineRouting.version], - // and [instance][google.cloud.tasks.v2.AppEngineRouting.instance]. Tasks which were created using - // the App Engine SDK might have a custom domain name. - // - // For more information, see - // [How Requests are - // Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - string host = 4; -} - -// The HTTP method used to deliver the task. -enum HttpMethod { - // HTTP method unspecified - HTTP_METHOD_UNSPECIFIED = 0; - - // HTTP POST - POST = 1; - - // HTTP GET - GET = 2; - - // HTTP HEAD - HEAD = 3; - - // HTTP PUT - PUT = 4; - - // HTTP DELETE - DELETE = 5; - - // HTTP PATCH - PATCH = 6; - - // HTTP OPTIONS - OPTIONS = 7; -} - -// Contains information needed for generating an -// [OAuth token](https://developers.google.com/identity/protocols/OAuth2). -// This type of authorization should generally only be used when calling Google -// APIs hosted on *.googleapis.com. -message OAuthToken { - // [Service account email](https://cloud.google.com/iam/docs/service-accounts) - // to be used for generating OAuth token. - // The service account must be within the same project as the queue. The - // caller must have iam.serviceAccounts.actAs permission for the service - // account. - string service_account_email = 1; - - // OAuth scope to be used for generating OAuth access token. - // If not specified, "https://www.googleapis.com/auth/cloud-platform" - // will be used. - string scope = 2; -} - -// Contains information needed for generating an -// [OpenID Connect -// token](https://developers.google.com/identity/protocols/OpenIDConnect). -// This type of authorization can be used for many scenarios, including -// calling Cloud Run, or endpoints where you intend to validate the token -// yourself. -message OidcToken { - // [Service account email](https://cloud.google.com/iam/docs/service-accounts) - // to be used for generating OIDC token. - // The service account must be within the same project as the queue. The - // caller must have iam.serviceAccounts.actAs permission for the service - // account. - string service_account_email = 1; - - // Audience to be used when generating OIDC token. If not specified, the URI - // specified in target will be used. - string audience = 2; -} diff --git a/protos/google/cloud/tasks/v2/task.proto b/protos/google/cloud/tasks/v2/task.proto deleted file mode 100644 index 9669b21a..00000000 --- a/protos/google/cloud/tasks/v2/task.proto +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.tasks.v2; - -import "google/api/resource.proto"; -import "google/cloud/tasks/v2/target.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.tasks.v2"; - -// A unit of scheduled work. -message Task { - option (google.api.resource) = { - type: "cloudtasks.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" - }; - - // The view specifies a subset of [Task][google.cloud.tasks.v2.Task] data. - // - // When a task is returned in a response, not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - enum View { - // Unspecified. Defaults to BASIC. - VIEW_UNSPECIFIED = 0; - - // The basic view omits fields which can be large or can contain - // sensitive data. - // - // This view does not include the - // [body in AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body]. - // Bodies are desirable to return only when needed, because they - // can be large and because of the sensitivity of the data that you - // choose to store in it. - BASIC = 1; - - // All information is returned. - // - // Authorization for [FULL][google.cloud.tasks.v2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Queue][google.cloud.tasks.v2.Queue] resource. - FULL = 2; - } - - // Optionally caller-specified in [CreateTask][google.cloud.tasks.v2.CloudTasks.CreateTask]. - // - // The task name. - // - // The task name must have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - // - // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), colons (:), or periods (.). - // For more information, see - // [Identifying - // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - // * `LOCATION_ID` is the canonical ID for the task's location. - // The list of available locations can be obtained by calling - // [ListLocations][google.cloud.location.Locations.ListLocations]. - // For more information, see https://cloud.google.com/about/locations/. - // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - // hyphens (-). The maximum length is 100 characters. - // * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), or underscores (_). The maximum length is 500 characters. - string name = 1; - - // Required. The message to send to the worker. - oneof message_type { - // HTTP request that is sent to the App Engine app handler. - // - // An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest] set. - AppEngineHttpRequest app_engine_http_request = 2; - - // HTTP request that is sent to the worker. - // - // An HTTP task is a task that has [HttpRequest][google.cloud.tasks.v2.HttpRequest] set. - HttpRequest http_request = 3; - } - - // The time when the task is scheduled to be attempted or retried. - // - // `schedule_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp schedule_time = 4; - - // Output only. The time that the task was created. - // - // `create_time` will be truncated to the nearest second. - google.protobuf.Timestamp create_time = 5; - - // The deadline for requests sent to the worker. If the worker does not - // respond by this deadline then the request is cancelled and the attempt - // is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - // task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig]. - // - // Note that when the request is cancelled, Cloud Tasks will stop listing for - // the response, but whether the worker stops processing depends on the - // worker. For example, if the worker is stuck, it may not react to cancelled - // requests. - // - // The default and maximum values depend on the type of request: - // - // * For [HTTP tasks][google.cloud.tasks.v2.HttpRequest], the default is 10 minutes. The deadline - // must be in the interval [15 seconds, 30 minutes]. - // - // * For [App Engine tasks][google.cloud.tasks.v2.AppEngineHttpRequest], 0 indicates that the - // request has the default deadline. The default deadline depends on the - // [scaling - // type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - // of the service: 10 minutes for standard apps with automatic scaling, 24 - // hours for standard apps with manual and basic scaling, and 60 minutes for - // flex apps. If the request deadline is set, it must be in the interval [15 - // seconds, 24 hours 15 seconds]. Regardless of the task's - // `dispatch_deadline`, the app handler will not run for longer than than - // the service's timeout. We recommend setting the `dispatch_deadline` to - // at most a few seconds more than the app handler's timeout. For more - // information see - // [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - // - // `dispatch_deadline` will be truncated to the nearest millisecond. The - // deadline is an approximate deadline. - google.protobuf.Duration dispatch_deadline = 6; - - // Output only. The number of attempts dispatched. - // - // This count includes attempts which have been dispatched but haven't - // received a response. - int32 dispatch_count = 7; - - // Output only. The number of attempts which have received a response. - int32 response_count = 8; - - // Output only. The status of the task's first attempt. - // - // Only [dispatch_time][google.cloud.tasks.v2.Attempt.dispatch_time] will be set. - // The other [Attempt][google.cloud.tasks.v2.Attempt] information is not retained by Cloud Tasks. - Attempt first_attempt = 9; - - // Output only. The status of the task's last attempt. - Attempt last_attempt = 10; - - // Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2.Task] has - // been returned. - View view = 11; -} - -// The status of a task attempt. -message Attempt { - // Output only. The time that this attempt was scheduled. - // - // `schedule_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp schedule_time = 1; - - // Output only. The time that this attempt was dispatched. - // - // `dispatch_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp dispatch_time = 2; - - // Output only. The time that this attempt response was received. - // - // `response_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp response_time = 3; - - // Output only. The response from the worker for this attempt. - // - // If `response_time` is unset, then the task has not been attempted or is - // currently running and the `response_status` field is meaningless. - google.rpc.Status response_status = 4; -} diff --git a/protos/google/cloud/tasks/v2beta2/cloudtasks.proto b/protos/google/cloud/tasks/v2beta2/cloudtasks.proto deleted file mode 100644 index 8b2fa57e..00000000 --- a/protos/google/cloud/tasks/v2beta2/cloudtasks.proto +++ /dev/null @@ -1,942 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/tasks/v2beta2/queue.proto"; -import "google/cloud/tasks/v2beta2/task.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "CloudTasksProto"; -option java_package = "com.google.cloud.tasks.v2beta2"; -option objc_class_prefix = "TASKS"; - -// Cloud Tasks allows developers to manage the execution of background -// work in their applications. -service CloudTasks { - option (google.api.default_host) = "cloudtasks.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists queues. - // - // Queues are returned in lexicographical order. - rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse) { - option (google.api.http) = { - get: "/v2beta2/{parent=projects/*/locations/*}/queues" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a queue. - rpc GetQueue(GetQueueRequest) returns (Queue) { - option (google.api.http) = { - get: "/v2beta2/{name=projects/*/locations/*/queues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a queue. - // - // Queues created with this method allow tasks to live for a maximum of 31 - // days. After a task is 31 days old, the task will be deleted regardless of whether - // it was dispatched or not. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc CreateQueue(CreateQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta2/{parent=projects/*/locations/*}/queues" - body: "queue" - }; - option (google.api.method_signature) = "parent,queue"; - } - - // Updates a queue. - // - // This method creates the queue if it does not exist and updates - // the queue if it does exist. - // - // Queues created with this method allow tasks to live for a maximum of 31 - // days. After a task is 31 days old, the task will be deleted regardless of whether - // it was dispatched or not. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc UpdateQueue(UpdateQueueRequest) returns (Queue) { - option (google.api.http) = { - patch: "/v2beta2/{queue.name=projects/*/locations/*/queues/*}" - body: "queue" - }; - option (google.api.method_signature) = "queue,update_mask"; - } - - // Deletes a queue. - // - // This command will delete the queue even if it has tasks in it. - // - // Note: If you delete a queue, a queue with the same name can't be created - // for 7 days. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc DeleteQueue(DeleteQueueRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2beta2/{name=projects/*/locations/*/queues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Purges a queue by deleting all of its tasks. - // - // All tasks created before this method is called are permanently deleted. - // - // Purge operations can take up to one minute to take effect. Tasks - // might be dispatched before the purge takes effect. A purge is irreversible. - rpc PurgeQueue(PurgeQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*}:purge" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Pauses the queue. - // - // If a queue is paused then the system will stop dispatching tasks - // until the queue is resumed via - // [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. Tasks can still be added - // when the queue is paused. A queue is paused if its - // [state][google.cloud.tasks.v2beta2.Queue.state] is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - rpc PauseQueue(PauseQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resume a queue. - // - // This method resumes a queue after it has been - // [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED] or - // [DISABLED][google.cloud.tasks.v2beta2.Queue.State.DISABLED]. The state of a queue is stored - // in the queue's [state][google.cloud.tasks.v2beta2.Queue.state]; after calling this method it - // will be set to [RUNNING][google.cloud.tasks.v2beta2.Queue.State.RUNNING]. - // - // WARNING: Resuming many high-QPS queues at the same time can - // lead to target overloading. If you are resuming high-QPS - // queues, follow the 500/50/5 pattern described in - // [Managing Cloud Tasks Scaling - // Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - rpc ResumeQueue(ResumeQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets the access control policy for a [Queue][google.cloud.tasks.v2beta2.Queue]. - // Returns an empty policy if the resource exists and does not have a policy - // set. - // - // Authorization requires the following - // [Google IAM](https://cloud.google.com/iam) permission on the specified - // resource parent: - // - // * `cloudtasks.queues.getIamPolicy` - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Sets the access control policy for a [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing - // policy. - // - // Note: The Cloud Console does not check queue-level IAM permissions yet. - // Project-level permissions are required to use the Cloud Console. - // - // Authorization requires the following - // [Google IAM](https://cloud.google.com/iam) permission on the specified - // resource parent: - // - // * `cloudtasks.queues.setIamPolicy` - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta2.Queue]. - // If the resource does not exist, this will return an empty set of - // permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - // - // Note: This operation is designed to be used for building permission-aware - // UIs and command-line tools, not for authorization checking. This operation - // may "fail open" without warning. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Lists the tasks in a queue. - // - // By default, only the [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC] view is retrieved - // due to performance considerations; - // [response_view][google.cloud.tasks.v2beta2.ListTasksRequest.response_view] controls the - // subset of information which is returned. - // - // The tasks may be returned in any order. The ordering may change at any - // time. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a task and adds it to a queue. - // - // Tasks cannot be updated after creation; there is no UpdateTask command. - // - // * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], the maximum task size is - // 100KB. - // * For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum task size is 1MB. - rpc CreateTask(CreateTaskRequest) returns (Task) { - option (google.api.http) = { - post: "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks" - body: "*" - }; - option (google.api.method_signature) = "parent,task"; - } - - // Deletes a task. - // - // A task can be deleted if it is scheduled or dispatched. A task - // cannot be deleted if it has completed successfully or permanently - // failed. - rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Leases tasks from a pull queue for - // [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - // - // This method is invoked by the worker to obtain a lease. The - // worker must acknowledge the task via - // [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] after they have - // performed the work associated with the task. - // - // The [payload][google.cloud.tasks.v2beta2.PullMessage.payload] is intended to store data that - // the worker needs to perform the work associated with the task. To - // return the payloads in the [response][google.cloud.tasks.v2beta2.LeaseTasksResponse], set - // [response_view][google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view] to - // [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]. - // - // A maximum of 10 qps of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] - // requests are allowed per - // queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - // is returned when this limit is - // exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] - // is also returned when - // [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] - // is exceeded. - rpc LeaseTasks(LeaseTasksRequest) returns (LeaseTasksResponse) { - option (google.api.http) = { - post: "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease" - body: "*" - }; - option (google.api.method_signature) = "parent,lease_duration"; - } - - // Acknowledges a pull task. - // - // The worker, that is, the entity that - // [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must call this method - // to indicate that the work associated with the task has finished. - // - // The worker must acknowledge a task within the - // [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration] or the lease - // will expire and the task will become available to be leased - // again. After the task is acknowledged, it will not be returned - // by a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks], - // [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or - // [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. - rpc AcknowledgeTask(AcknowledgeTaskRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge" - body: "*" - }; - option (google.api.method_signature) = "name,schedule_time"; - } - - // Renew the current lease of a pull task. - // - // The worker can use this method to extend the lease by a new - // duration, starting from now. The new task lease will be - // returned in the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - rpc RenewLease(RenewLeaseRequest) returns (Task) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease" - body: "*" - }; - option (google.api.method_signature) = "name,schedule_time,lease_duration"; - } - - // Cancel a pull task's lease. - // - // The worker can use this method to cancel a task's lease by - // setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] to now. This will - // make the task available to be leased to the next caller of - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. - rpc CancelLease(CancelLeaseRequest) returns (Task) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease" - body: "*" - }; - option (google.api.method_signature) = "name,schedule_time"; - } - - // Forces a task to run now. - // - // When this method is called, Cloud Tasks will dispatch the task, even if - // the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta2.RateLimits] or - // is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - // - // This command is meant to be used for manual debugging. For - // example, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] can be used to retry a failed - // task after a fix has been made or to manually force a task to be - // dispatched now. - // - // The dispatched task is returned. That is, the task that is returned - // contains the [status][google.cloud.tasks.v2beta2.Task.status] after the task is dispatched but - // before the task is received by its target. - // - // If Cloud Tasks receives a successful response from the task's - // target, then the task will be deleted; otherwise the task's - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be reset to the time that - // [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] was called plus the retry delay specified - // in the queue's [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig]. - // - // [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] returns - // [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - // task that has already succeeded or permanently failed. - // - // [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called on a - // [pull task][google.cloud.tasks.v2beta2.PullMessage]. - rpc RunTask(RunTaskRequest) returns (Task) { - option (google.api.http) = { - post: "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues]. -message ListQueuesRequest { - // Required. The location name. - // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2beta2.Queue] - // field can be used as a filter and several operators as supported. - // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - // described in - // [Stackdriver's Advanced Logs - // Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - // - // Sample filter "app_engine_http_target: *". - // - // Note that using filters might cause fewer queues than the - // requested_page size to be returned. - string filter = 2; - - // Requested page size. - // - // The maximum page size is 9800. If unspecified, the page size will - // be the maximum. Fewer queues than requested might be returned, - // even if more queues exist; use the - // [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] in the - // response to determine if more queues exist. - int32 page_size = 3; - - // A token identifying the page of results to return. - // - // To request the first page results, page_token must be empty. To - // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token] returned - // from the previous call to [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] - // method. It is an error to switch the value of the - // [filter][google.cloud.tasks.v2beta2.ListQueuesRequest.filter] while iterating through pages. - string page_token = 4; - - // Optional. Read mask is used for a more granular control over what the API returns. - // If the mask is not present all fields will be returned except - // [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - // specified in the mask. - google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues]. -message ListQueuesResponse { - // The list of queues. - repeated Queue queues = 1; - - // A token to retrieve next page of results. - // - // To return the next page of results, call - // [ListQueues][google.cloud.tasks.v2beta2.CloudTasks.ListQueues] with this value as the - // [page_token][google.cloud.tasks.v2beta2.ListQueuesRequest.page_token]. - // - // If the next_page_token is empty, there are no more results. - // - // The page token is valid for only 2 hours. - string next_page_token = 2; -} - -// Request message for [GetQueue][google.cloud.tasks.v2beta2.CloudTasks.GetQueue]. -message GetQueueRequest { - // Required. The resource name of the queue. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // Optional. Read mask is used for a more granular control over what the API returns. - // If the mask is not present all fields will be returned except - // [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - // specified in the mask. - google.protobuf.FieldMask read_mask = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue]. -message CreateQueueRequest { - // Required. The location name in which the queue will be created. - // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - // - // The list of allowed locations can be obtained by calling Cloud - // Tasks' implementation of - // [ListLocations][google.cloud.location.Locations.ListLocations]. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // Required. The queue to create. - // - // [Queue's name][google.cloud.tasks.v2beta2.Queue.name] cannot be the same as an existing queue. - Queue queue = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue]. -message UpdateQueueRequest { - // Required. The queue to create or update. - // - // The queue's [name][google.cloud.tasks.v2beta2.Queue.name] must be specified. - // - // Output only fields cannot be modified using UpdateQueue. - // Any value specified for an output only field will be ignored. - // The queue's [name][google.cloud.tasks.v2beta2.Queue.name] cannot be changed. - Queue queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // A mask used to specify which fields of the queue are being updated. - // - // If empty, then all fields will be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue]. -message DeleteQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue]. -message PurgeQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue]. -message PauseQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. -message ResumeQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for listing tasks using [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. -message ListTasksRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 2; - - // Maximum page size. - // - // Fewer tasks than requested might be returned, even if more tasks exist; use - // [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] in the response to - // determine if more tasks exist. - // - // The maximum page size is 1000. If unspecified, the page size will be the - // maximum. - int32 page_size = 4; - - // A token identifying the page of results to return. - // - // To request the first page results, page_token must be empty. To - // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token] returned - // from the previous call to [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] - // method. - // - // The page token is valid for only 2 hours. - string page_token = 5; -} - -// Response message for listing tasks using [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. -message ListTasksResponse { - // The list of tasks. - repeated Task tasks = 1; - - // A token to retrieve next page of results. - // - // To return the next page of results, call - // [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks] with this value as the - // [page_token][google.cloud.tasks.v2beta2.ListTasksRequest.page_token]. - // - // If the next_page_token is empty, there are no more results. - string next_page_token = 2; -} - -// Request message for getting a task using [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask]. -message GetTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 2; -} - -// Request message for [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. -message CreateTaskRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - // - // The queue must already exist. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // Required. The task to add. - // - // Task names have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - // The user can optionally specify a task [name][google.cloud.tasks.v2beta2.Task.name]. If a - // name is not specified then the system will generate a random - // unique task id, which will be set in the task returned in the - // [response][google.cloud.tasks.v2beta2.Task.name]. - // - // If [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] is not set or is in the - // past then Cloud Tasks will set it to the current time. - // - // Task De-duplication: - // - // Explicitly specifying a task ID enables task de-duplication. If - // a task's ID is identical to that of an existing task or a task - // that was deleted or completed recently then the call will fail - // with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - // If the task's queue was created using Cloud Tasks, then another task with - // the same name can't be created for ~1hour after the original task was - // deleted or completed. If the task's queue was created using queue.yaml or - // queue.xml, then another task with the same name can't be created - // for ~9days after the original task was deleted or completed. - // - // Because there is an extra lookup cost to identify duplicate task - // names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] calls have significantly - // increased latency. Using hashed strings for the task id or for - // the prefix of the task id is recommended. Choosing task ids that - // are sequential or have sequential prefixes, for example using a - // timestamp, causes an increase in latency and error rates in all - // task commands. The infrastructure relies on an approximately - // uniform distribution of task ids to store and serve tasks - // efficiently. - Task task = 2 [(google.api.field_behavior) = REQUIRED]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 3; -} - -// Request message for deleting a task using -// [DeleteTask][google.cloud.tasks.v2beta2.CloudTasks.DeleteTask]. -message DeleteTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; -} - -// Request message for leasing tasks using [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. -message LeaseTasksRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The maximum number of tasks to lease. - // - // The system will make a best effort to return as close to as - // `max_tasks` as possible. - // - // The largest that `max_tasks` can be is 1000. - // - // The maximum total size of a [lease tasks response][google.cloud.tasks.v2beta2.LeaseTasksResponse] is - // 32 MB. If the sum of all task sizes requested reaches this limit, - // fewer tasks than requested are returned. - int32 max_tasks = 2; - - // Required. The duration of the lease. - // - // Each task returned in the [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will - // have its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] set to the current - // time plus the `lease_duration`. The task is leased until its - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]; thus, the task will not be - // returned to another [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call - // before its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - // - // - // After the worker has successfully finished the work associated - // with the task, the worker must call via - // [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] before the - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. Otherwise the task will be - // returned to a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] call so - // that another worker can retry it. - // - // The maximum lease duration is 1 week. - // `lease_duration` will be truncated to the nearest second. - google.protobuf.Duration lease_duration = 3 [(google.api.field_behavior) = REQUIRED]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 4; - - // `filter` can be used to specify a subset of tasks to lease. - // - // When `filter` is set to `tag=` then the - // [response][google.cloud.tasks.v2beta2.LeaseTasksResponse] will contain only tasks whose - // [tag][google.cloud.tasks.v2beta2.PullMessage.tag] is equal to ``. `` must be - // less than 500 characters. - // - // When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - // the same tag as the task with the oldest - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be returned. - // - // Grammar Syntax: - // - // * `filter = "tag=" tag | "tag_function=" function` - // - // * `tag = string` - // - // * `function = "oldest_tag()"` - // - // The `oldest_tag()` function returns tasks which have the same tag as the - // oldest task (ordered by schedule time). - // - // SDK compatibility: Although the SDK allows tags to be either - // string or - // [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - // only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - // aren't UTF-8 encoded can't be used in the - // [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter] and the task's - // [tag][google.cloud.tasks.v2beta2.PullMessage.tag] will be displayed as empty in Cloud Tasks. - string filter = 5; -} - -// Response message for leasing tasks using [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. -message LeaseTasksResponse { - // The leased tasks. - repeated Task tasks = 1; -} - -// Request message for acknowledging a task using -// [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask]. -message AcknowledgeTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // Required. The task's current schedule time, available in the - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - // [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction is - // to ensure that your worker currently holds the lease. - google.protobuf.Timestamp schedule_time = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for renewing a lease using -// [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease]. -message RenewLeaseRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // Required. The task's current schedule time, available in the - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - // [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction is - // to ensure that your worker currently holds the lease. - google.protobuf.Timestamp schedule_time = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired new lease duration, starting from now. - // - // - // The maximum lease duration is 1 week. - // `lease_duration` will be truncated to the nearest second. - google.protobuf.Duration lease_duration = 3 [(google.api.field_behavior) = REQUIRED]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 4; -} - -// Request message for canceling a lease using -// [CancelLease][google.cloud.tasks.v2beta2.CloudTasks.CancelLease]. -message CancelLeaseRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // Required. The task's current schedule time, available in the - // [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or - // [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction is - // to ensure that your worker currently holds the lease. - google.protobuf.Timestamp schedule_time = 2 [(google.api.field_behavior) = REQUIRED]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 3; -} - -// Request message for forcing a task to run now using -// [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask]. -message RunTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta2.Task] resource. - Task.View response_view = 2; -} diff --git a/protos/google/cloud/tasks/v2beta2/queue.proto b/protos/google/cloud/tasks/v2beta2/queue.proto deleted file mode 100644 index 2d6ba2e1..00000000 --- a/protos/google/cloud/tasks/v2beta2/queue.proto +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/tasks/v2beta2/target.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "QueueProto"; -option java_package = "com.google.cloud.tasks.v2beta2"; - -// A queue is a container of related tasks. Queues are configured to manage -// how those tasks are dispatched. Configurable properties include rate limits, -// retry options, target types, and others. -message Queue { - option (google.api.resource) = { - type: "cloudtasks.googleapis.com/Queue" - pattern: "projects/{project}/locations/{location}/queues/{queue}" - }; - - // State of the queue. - enum State { - // Unspecified state. - STATE_UNSPECIFIED = 0; - - // The queue is running. Tasks can be dispatched. - // - // If the queue was created using Cloud Tasks and the queue has - // had no activity (method calls or task dispatches) for 30 days, - // the queue may take a few minutes to re-activate. Some method - // calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - // tasks may not be dispatched for a few minutes until the queue - // has been re-activated. - RUNNING = 1; - - // Tasks are paused by the user. If the queue is paused then Cloud - // Tasks will stop delivering tasks from it, but more tasks can - // still be added to it by the user. When a pull queue is paused, - // all [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls will return a - // [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION]. - PAUSED = 2; - - // The queue is disabled. - // - // A queue becomes `DISABLED` when - // [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - // or - // [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - // is uploaded which does not contain the queue. You cannot directly disable - // a queue. - // - // When a queue is disabled, tasks can still be added to a queue - // but the tasks are not dispatched and - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] calls return a - // `FAILED_PRECONDITION` error. - // - // To permanently delete this queue and all of its tasks, call - // [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue]. - DISABLED = 3; - } - - // Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue], - // after which it becomes output only. - // - // The queue name. - // - // The queue name must have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - // - // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), colons (:), or periods (.). - // For more information, see - // [Identifying - // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - // * `LOCATION_ID` is the canonical ID for the queue's location. - // The list of available locations can be obtained by calling - // [ListLocations][google.cloud.location.Locations.ListLocations]. - // For more information, see https://cloud.google.com/about/locations/. - // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - // hyphens (-). The maximum length is 100 characters. - string name = 1; - - // Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta2.CloudTasks.CreateQueue][], - // after which the queue config type becomes output only, though fields within - // the config are mutable. - // - // The queue's target. - // - // The target applies to all tasks in the queue. - oneof target_type { - // App Engine HTTP target. - // - // An App Engine queue is a queue that has an [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget]. - AppEngineHttpTarget app_engine_http_target = 3; - - // Pull target. - // - // A pull queue is a queue that has a [PullTarget][google.cloud.tasks.v2beta2.PullTarget]. - PullTarget pull_target = 4; - } - - // Rate limits for task dispatches. - // - // [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] and - // [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] are related because they both - // control task attempts however they control how tasks are - // attempted in different ways: - // - // * [rate_limits][google.cloud.tasks.v2beta2.Queue.rate_limits] controls the total rate of - // dispatches from a queue (i.e. all traffic dispatched from the - // queue, regardless of whether the dispatch is from a first - // attempt or a retry). - // * [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls what happens to - // particular a task after its first attempt fails. That is, - // [retry_config][google.cloud.tasks.v2beta2.Queue.retry_config] controls task retries (the - // second attempt, third attempt, etc). - RateLimits rate_limits = 5; - - // Settings that determine the retry behavior. - // - // * For tasks created using Cloud Tasks: the queue-level retry settings - // apply to all tasks in the queue that were created using Cloud Tasks. - // Retry settings cannot be set on individual tasks. - // * For tasks created using the App Engine SDK: the queue-level retry - // settings apply to all tasks in the queue which do not have retry settings - // explicitly set on the task and were created by the App Engine SDK. See - // [App Engine - // documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - RetryConfig retry_config = 6; - - // Output only. The state of the queue. - // - // `state` can only be changed by calling - // [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue], - // [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or uploading - // [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - // [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] cannot be used to change `state`. - State state = 7; - - // Output only. The last time this queue was purged. - // - // All tasks that were [created][google.cloud.tasks.v2beta2.Task.create_time] before this time - // were purged. - // - // A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue], the - // [App Engine Task Queue SDK, or the Cloud - // Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - // - // Purge time will be truncated to the nearest microsecond. Purge - // time will be unset if the queue has never been purged. - google.protobuf.Timestamp purge_time = 8; - - // The maximum amount of time that a task will be retained in - // this queue. - // - // Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - // After a task has lived for `task_ttl`, the task will be deleted - // regardless of whether it was dispatched or not. - // - // The `task_ttl` for queues created via queue.yaml/xml is equal to the - // maximum duration because there is a - // [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - // these queues. To view the maximum valid duration, see the documentation for - // [Duration][google.protobuf.Duration]. - google.protobuf.Duration task_ttl = 9; - - // The task tombstone time to live (TTL). - // - // After a task is deleted or completed, the task's tombstone is - // retained for the length of time specified by `tombstone_ttl`. - // The tombstone is used by task de-duplication; another task with the same - // name can't be created until the tombstone has expired. For more information - // about task de-duplication, see the documentation for - // [CreateTaskRequest][google.cloud.tasks.v2beta2.CreateTaskRequest.task]. - // - // Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - google.protobuf.Duration tombstone_ttl = 10; - - // Output only. The realtime, informational statistics for a queue. In order - // to receive the statistics the caller should include this field in the - // FieldMask. - QueueStats stats = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Rate limits. -// -// This message determines the maximum rate that tasks can be dispatched by a -// queue, regardless of whether the dispatch is a first task attempt or a retry. -// -// Note: The debugging command, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask], will run a task -// even if the queue has reached its [RateLimits][google.cloud.tasks.v2beta2.RateLimits]. -message RateLimits { - // The maximum rate at which tasks are dispatched from this queue. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], the maximum allowed value - // is 500. - // * This field is output only for [pull queues][google.cloud.tasks.v2beta2.PullTarget]. In addition to the - // `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests are allowed per pull queue. - // - // - // This field has the same meaning as - // [rate in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - double max_tasks_dispatched_per_second = 1; - - // The max burst size. - // - // Max burst size limits how fast tasks in queue are processed when - // many tasks are in the queue and the rate is high. This field - // allows the queue to have a high rate so processing starts shortly - // after a task is enqueued, but still limits resource usage when - // many tasks are enqueued in a short period of time. - // - // The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - // algorithm is used to control the rate of task dispatches. Each - // queue has a token bucket that holds tokens, up to the maximum - // specified by `max_burst_size`. Each time a task is dispatched, a - // token is removed from the bucket. Tasks will be dispatched until - // the queue's bucket runs out of tokens. The bucket will be - // continuously refilled with new tokens based on - // [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - // - // The default value of `max_burst_size` is picked by Cloud Tasks - // based on the value of - // [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - // - // The maximum value of `max_burst_size` is 500. - // - // For App Engine queues that were created or updated using - // `queue.yaml/xml`, `max_burst_size` is equal to - // [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - // If - // [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is called on a queue without - // explicitly setting a value for `max_burst_size`, - // `max_burst_size` value will get updated if - // [UpdateQueue][google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue] is updating - // [max_dispatches_per_second][RateLimits.max_dispatches_per_second]. - // - int32 max_burst_size = 2; - - // The maximum number of concurrent tasks that Cloud Tasks allows - // to be dispatched for this queue. After this threshold has been - // reached, Cloud Tasks stops dispatching tasks until the number of - // concurrent requests decreases. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // The maximum allowed value is 5,000. - // - // This field is output only for - // [pull queues][google.cloud.tasks.v2beta2.PullTarget] and always -1, which indicates no limit. No other - // queue types can have `max_concurrent_tasks` set to -1. - // - // - // This field has the same meaning as - // [max_concurrent_requests in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - int32 max_concurrent_tasks = 3; -} - -// Retry config. -// -// These settings determine how a failed task attempt is retried. -message RetryConfig { - // Number of attempts per task. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // - // This field has the same meaning as - // [task_retry_limit in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - oneof num_attempts { - // The maximum number of attempts for a task. - // - // Cloud Tasks will attempt the task `max_attempts` times (that - // is, if the first attempt fails, then there will be - // `max_attempts - 1` retries). Must be > 0. - int32 max_attempts = 1; - - // If true, then the number of attempts is unlimited. - bool unlimited_attempts = 2; - } - - // If positive, `max_retry_duration` specifies the time limit for - // retrying a failed task, measured from when the task was first - // attempted. Once `max_retry_duration` time has passed *and* the - // task has been attempted [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] - // times, no further attempts will be made and the task will be - // deleted. - // - // If zero, then the task age is unlimited. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // This field is output only for [pull queues][google.cloud.tasks.v2beta2.PullTarget]. - // - // - // `max_retry_duration` will be truncated to the nearest second. - // - // This field has the same meaning as - // [task_age_limit in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration max_retry_duration = 3; - - // A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] for retry between - // [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - // [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration after it fails, - // if the queue's [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the task should be - // retried. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // This field is output only for [pull queues][google.cloud.tasks.v2beta2.PullTarget]. - // - // - // `min_backoff` will be truncated to the nearest second. - // - // This field has the same meaning as - // [min_backoff_seconds in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration min_backoff = 4; - - // A task will be [scheduled][google.cloud.tasks.v2beta2.Task.schedule_time] for retry between - // [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] and - // [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] duration after it fails, - // if the queue's [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig] specifies that the task should be - // retried. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // This field is output only for [pull queues][google.cloud.tasks.v2beta2.PullTarget]. - // - // - // `max_backoff` will be truncated to the nearest second. - // - // This field has the same meaning as - // [max_backoff_seconds in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration max_backoff = 5; - - // The time between retries will double `max_doublings` times. - // - // A task's retry interval starts at - // [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff], then doubles - // `max_doublings` times, then increases linearly, and finally - // retries at intervals of - // [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] up to - // [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] times. - // - // For example, if [min_backoff][google.cloud.tasks.v2beta2.RetryConfig.min_backoff] is 10s, - // [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] is 300s, and - // `max_doublings` is 3, then the a task will first be retried in - // 10s. The retry interval will double three times, and then - // increase linearly by 2^3 * 10s. Finally, the task will retry at - // intervals of [max_backoff][google.cloud.tasks.v2beta2.RetryConfig.max_backoff] until the - // task has been attempted [max_attempts][google.cloud.tasks.v2beta2.RetryConfig.max_attempts] - // times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, - // 240s, 300s, 300s, .... - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // This field is output only for [pull queues][google.cloud.tasks.v2beta2.PullTarget]. - // - // - // This field has the same meaning as - // [max_doublings in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - int32 max_doublings = 6; -} - -// Statistics for a queue. -message QueueStats { - // Output only. An estimation of the number of tasks in the queue, that is, the tasks in - // the queue that haven't been executed, the tasks in the queue which the - // queue has dispatched but has not yet received a reply for, and the failed - // tasks that the queue is retrying. - int64 tasks_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An estimation of the nearest time in the future where a task in the queue - // is scheduled to be executed. - google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks that the queue has dispatched and received a reply for - // during the last minute. This variable counts both successful and - // non-successful executions. - int64 executed_last_minute_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of requests that the queue has dispatched but has not received - // a reply for yet. - int64 concurrent_dispatches_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current maximum number of tasks per second executed by the queue. - // The maximum value of this variable is controlled by the RateLimits of the - // Queue. However, this value could be less to avoid overloading the endpoints - // tasks in the queue are targeting. - double effective_execution_rate = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/protos/google/cloud/tasks/v2beta2/target.proto b/protos/google/cloud/tasks/v2beta2/target.proto deleted file mode 100644 index 7ee837db..00000000 --- a/protos/google/cloud/tasks/v2beta2/target.proto +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta2; - - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "TargetProto"; -option java_package = "com.google.cloud.tasks.v2beta2"; - -// Pull target. -message PullTarget { - -} - -// The pull message contains data that can be used by the caller of -// [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process the task. -// -// This proto can only be used for tasks in a queue which has -// [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] set. -message PullMessage { - // A data payload consumed by the worker to execute the task. - bytes payload = 1; - - // The task's tag. - // - // Tags allow similar tasks to be processed in a batch. If you label - // tasks with a tag, your worker can - // [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the same tag using - // [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, if you want to - // aggregate the events associated with a specific user once a day, - // you could tag tasks with the user ID. - // - // The task's tag can only be set when the - // [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - // - // The tag must be less than 500 characters. - // - // SDK compatibility: Although the SDK allows tags to be either - // string or - // [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - // only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - // encoded, the tag will be empty when the task is returned by Cloud Tasks. - string tag = 2; -} - -// App Engine HTTP target. -// -// The task will be delivered to the App Engine application hostname -// specified by its [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget] and [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest]. -// The documentation for [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] explains how the -// task's host URL is constructed. -// -// Using [AppEngineHttpTarget][google.cloud.tasks.v2beta2.AppEngineHttpTarget] requires -// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -// Google IAM permission for the project -// and the following scope: -// -// `https://www.googleapis.com/auth/cloud-platform` -message AppEngineHttpTarget { - // Overrides for the - // [task-level app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - // - // If set, `app_engine_routing_override` is used for all tasks in - // the queue, no matter what the setting is for the - // [task-level app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - AppEngineRouting app_engine_routing_override = 1; -} - -// App Engine HTTP request. -// -// The message defines the HTTP request that is sent to an App Engine app when -// the task is dispatched. -// -// This proto can only be used for tasks in a queue which has -// [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] set. -// -// Using [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] requires -// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -// Google IAM permission for the project -// and the following scope: -// -// `https://www.googleapis.com/auth/cloud-platform` -// -// The task will be delivered to the App Engine app which belongs to the same -// project as the queue. For more information, see -// [How Requests are -// Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) -// and how routing is affected by -// [dispatch -// files](https://cloud.google.com/appengine/docs/python/config/dispatchref). -// Traffic is encrypted during transport and never leaves Google datacenters. -// Because this traffic is carried over a communication mechanism internal to -// Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). -// The request to the handler, however, will appear to have used the HTTP -// protocol. -// -// The [AppEngineRouting][google.cloud.tasks.v2beta2.AppEngineRouting] used to construct the URL that the task is -// delivered to can be set at the queue-level or task-level: -// -// * If set, -// [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] -// is used for all tasks in the queue, no matter what the setting -// is for the -// [task-level app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. -// -// -// The `url` that the task will be sent to is: -// -// * `url =` [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] `+` -// [relative_url][google.cloud.tasks.v2beta2.AppEngineHttpRequest.relative_url] -// -// Tasks can be dispatched to secure app handlers, unsecure app handlers, and -// URIs restricted with -// [`login: -// admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). -// Because tasks are not run as any user, they cannot be dispatched to URIs -// restricted with -// [`login: -// required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) -// Task dispatches also do not follow redirects. -// -// The task attempt has succeeded if the app's request handler returns an HTTP -// response code in the range [`200` - `299`]. The task attempt has failed if -// the app's handler returns a non-2xx response code or Cloud Tasks does -// not receive response before the [deadline][Task.dispatch_deadline]. Failed -// tasks will be retried according to the -// [retry configuration][google.cloud.tasks.v2beta2.Queue.retry_config]. `503` (Service Unavailable) is -// considered an App Engine system error instead of an application error and -// will cause Cloud Tasks' traffic congestion control to temporarily throttle -// the queue's dispatches. Unlike other types of task targets, a `429` (Too Many -// Requests) response from an app handler does not cause traffic congestion -// control to throttle the queue. -message AppEngineHttpRequest { - // The HTTP method to use for the request. The default is POST. - // - // The app's request handler for the task's target URL must be able to handle - // HTTP requests with this http_method, otherwise the task attempt fails with - // error code 405 (Method Not Allowed). See [Writing a push task request - // handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - // and the App Engine documentation for your runtime on [How Requests are - // Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - HttpMethod http_method = 1; - - // Task-level setting for App Engine routing. - // - // If set, - // [app_engine_routing_override][google.cloud.tasks.v2beta2.AppEngineHttpTarget.app_engine_routing_override] - // is used for all tasks in the queue, no matter what the setting is for the - // [task-level app_engine_routing][google.cloud.tasks.v2beta2.AppEngineHttpRequest.app_engine_routing]. - AppEngineRouting app_engine_routing = 2; - - // The relative URL. - // - // The relative URL must begin with "/" and must be a valid HTTP relative URL. - // It can contain a path and query string arguments. - // If the relative URL is empty, then the root path "/" will be used. - // No spaces are allowed, and the maximum length allowed is 2083 characters. - string relative_url = 3; - - // HTTP request headers. - // - // This map contains the header field names and values. - // Headers can be set when the - // [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - // Repeated headers are not supported but a header value can contain commas. - // - // Cloud Tasks sets some headers to default values: - // - // * `User-Agent`: By default, this header is - // `"AppEngine-Google; (+http://code.google.com/appengine)"`. - // This header can be modified, but Cloud Tasks will append - // `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - // modified `User-Agent`. - // - // If the task has a [payload][google.cloud.tasks.v2beta2.AppEngineHttpRequest.payload], Cloud - // Tasks sets the following headers: - // - // * `Content-Type`: By default, the `Content-Type` header is set to - // `"application/octet-stream"`. The default can be overridden by explicitly - // setting `Content-Type` to a particular media type when the - // [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - // For example, `Content-Type` can be set to `"application/json"`. - // * `Content-Length`: This is computed by Cloud Tasks. This value is - // output only. It cannot be changed. - // - // The headers below cannot be set or overridden: - // - // * `Host` - // * `X-Google-*` - // * `X-AppEngine-*` - // - // In addition, Cloud Tasks sets some headers when the task is dispatched, - // such as headers containing information about the task; see - // [request - // headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - // These headers are set only when the task is dispatched, so they are not - // visible when the task is returned in a Cloud Tasks response. - // - // Although there is no specific limit for the maximum number of headers or - // the size, there is a limit on the maximum size of the [Task][google.cloud.tasks.v2beta2.Task]. For more - // information, see the [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask] documentation. - map headers = 4; - - // Payload. - // - // The payload will be sent as the HTTP message body. A message - // body, and thus a payload, is allowed only if the HTTP method is - // POST or PUT. It is an error to set a data payload on a task with - // an incompatible [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. - bytes payload = 5; -} - -// App Engine Routing. -// -// Defines routing characteristics specific to App Engine - service, version, -// and instance. -// -// For more information about services, versions, and instances see -// [An Overview of App -// Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), -// [Microservices Architecture on Google App -// Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), -// [App Engine Standard request -// routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), -// and [App Engine Flex request -// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). -message AppEngineRouting { - // App service. - // - // By default, the task is sent to the service which is the default - // service when the task is attempted. - // - // For some queues or tasks which were created using the App Engine - // Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable - // into [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For example, some tasks - // which were created using the App Engine SDK use a custom domain - // name; custom domains are not parsed by Cloud Tasks. If - // [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, then - // [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the empty string. - string service = 1; - - // App version. - // - // By default, the task is sent to the version which is the default - // version when the task is attempted. - // - // For some queues or tasks which were created using the App Engine - // Task Queue API, [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable - // into [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance]. For example, some tasks - // which were created using the App Engine SDK use a custom domain - // name; custom domains are not parsed by Cloud Tasks. If - // [host][google.cloud.tasks.v2beta2.AppEngineRouting.host] is not parsable, then - // [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] are the empty string. - string version = 2; - - // App instance. - // - // By default, the task is sent to an instance which is available when - // the task is attempted. - // - // Requests can only be sent to a specific instance if - // [manual scaling is used in App Engine - // Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - // App Engine Flex does not support instances. For more information, see - // [App Engine Standard request - // routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - // and [App Engine Flex request - // routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - string instance = 3; - - // Output only. The host that the task is sent to. - // - // For more information, see - // [How Requests are - // Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - // - // The host is constructed as: - // - // - // * `host = [application_domain_name]`
- // `| [service] + '.' + [application_domain_name]`
- // `| [version] + '.' + [application_domain_name]`
- // `| [version_dot_service]+ '.' + [application_domain_name]`
- // `| [instance] + '.' + [application_domain_name]`
- // `| [instance_dot_service] + '.' + [application_domain_name]`
- // `| [instance_dot_version] + '.' + [application_domain_name]`
- // `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` - // - // * `application_domain_name` = The domain name of the app, for - // example .appspot.com, which is associated with the - // queue's project ID. Some tasks which were created using the App Engine - // SDK use a custom domain name. - // - // * `service =` [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - // - // * `version =` [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - // - // * `version_dot_service =` - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` - // [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - // - // * `instance =` [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] - // - // * `instance_dot_service =` - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' +` - // [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - // - // * `instance_dot_version =` - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' +` - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] - // - // * `instance_dot_version_dot_service =` - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] `+ '.' +` - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] `+ '.' +` - // [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] - // - // If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service] is empty, then the task will be sent - // to the service which is the default service when the task is attempted. - // - // If [version][google.cloud.tasks.v2beta2.AppEngineRouting.version] is empty, then the task will be sent - // to the version which is the default version when the task is attempted. - // - // If [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is empty, then the task - // will be sent to an instance which is available when the task is - // attempted. - // - // If [service][google.cloud.tasks.v2beta2.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta2.AppEngineRouting.version], or - // [instance][google.cloud.tasks.v2beta2.AppEngineRouting.instance] is invalid, then the task - // will be sent to the default version of the default service when - // the task is attempted. - string host = 4; -} - -// The HTTP method used to execute the task. -enum HttpMethod { - // HTTP method unspecified - HTTP_METHOD_UNSPECIFIED = 0; - - // HTTP POST - POST = 1; - - // HTTP GET - GET = 2; - - // HTTP HEAD - HEAD = 3; - - // HTTP PUT - PUT = 4; - - // HTTP DELETE - DELETE = 5; -} diff --git a/protos/google/cloud/tasks/v2beta2/task.proto b/protos/google/cloud/tasks/v2beta2/task.proto deleted file mode 100644 index 5e5c3575..00000000 --- a/protos/google/cloud/tasks/v2beta2/task.proto +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta2; - -import "google/api/resource.proto"; -import "google/cloud/tasks/v2beta2/target.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.tasks.v2beta2"; - -// A unit of scheduled work. -message Task { - option (google.api.resource) = { - type: "cloudtasks.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" - }; - - // The view specifies a subset of [Task][google.cloud.tasks.v2beta2.Task] data. - // - // When a task is returned in a response, not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - enum View { - // Unspecified. Defaults to BASIC. - VIEW_UNSPECIFIED = 0; - - // The basic view omits fields which can be large or can contain - // sensitive data. - // - // This view does not include the - // ([payload in AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] and - // [payload in PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). These payloads are - // desirable to return only when needed, because they can be large - // and because of the sensitivity of the data that you choose to - // store in it. - BASIC = 1; - - // All information is returned. - // - // Authorization for [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Queue][google.cloud.tasks.v2beta2.Queue] resource. - FULL = 2; - } - - // Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]. - // - // The task name. - // - // The task name must have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - // - // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), colons (:), or periods (.). - // For more information, see - // [Identifying - // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - // * `LOCATION_ID` is the canonical ID for the task's location. - // The list of available locations can be obtained by calling - // [ListLocations][google.cloud.location.Locations.ListLocations]. - // For more information, see https://cloud.google.com/about/locations/. - // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - // hyphens (-). The maximum length is 100 characters. - // * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), or underscores (_). The maximum length is 500 characters. - string name = 1; - - // Required. - // - // The task's payload is used by the task's target to process the task. - // A payload is valid only if it is compatible with the queue's target. - oneof payload_type { - // App Engine HTTP request that is sent to the task's target. Can - // be set only if - // [app_engine_http_target][google.cloud.tasks.v2beta2.Queue.app_engine_http_target] is set - // on the queue. - // - // An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] set. - AppEngineHttpRequest app_engine_http_request = 3; - - // [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process the task. Can be - // set only if [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] is set on the queue. - // - // A pull task is a task that has [PullMessage][google.cloud.tasks.v2beta2.PullMessage] set. - PullMessage pull_message = 4; - } - - // The time when the task is scheduled to be attempted. - // - // For App Engine queues, this is when the task will be attempted or retried. - // - // For pull queues, this is the time when the task is available to - // be leased; if a task is currently leased, this is the time when - // the current lease expires, that is, the time that the task was - // leased plus the [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. - // - // `schedule_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp schedule_time = 5; - - // Output only. The time that the task was created. - // - // `create_time` will be truncated to the nearest second. - google.protobuf.Timestamp create_time = 6; - - // Output only. The task status. - TaskStatus status = 7; - - // Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta2.Task] has - // been returned. - View view = 8; -} - -// Status of the task. -message TaskStatus { - // Output only. The number of attempts dispatched. - // - // This count includes attempts which have been dispatched but haven't - // received a response. - int32 attempt_dispatch_count = 1; - - // Output only. The number of attempts which have received a response. - // - // This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage]. - int32 attempt_response_count = 2; - - // Output only. The status of the task's first attempt. - // - // Only [dispatch_time][google.cloud.tasks.v2beta2.AttemptStatus.dispatch_time] will be set. - // The other [AttemptStatus][google.cloud.tasks.v2beta2.AttemptStatus] information is not retained by Cloud Tasks. - // - // This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage]. - AttemptStatus first_attempt_status = 3; - - // Output only. The status of the task's last attempt. - // - // This field is not calculated for [pull tasks][google.cloud.tasks.v2beta2.PullMessage]. - AttemptStatus last_attempt_status = 4; -} - -// The status of a task attempt. -message AttemptStatus { - // Output only. The time that this attempt was scheduled. - // - // `schedule_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp schedule_time = 1; - - // Output only. The time that this attempt was dispatched. - // - // `dispatch_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp dispatch_time = 2; - - // Output only. The time that this attempt response was received. - // - // `response_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp response_time = 3; - - // Output only. The response from the target for this attempt. - // - // If the task has not been attempted or the task is currently running - // then the response status is unset. - google.rpc.Status response_status = 4; -} diff --git a/protos/google/cloud/tasks/v2beta3/cloudtasks.proto b/protos/google/cloud/tasks/v2beta3/cloudtasks.proto deleted file mode 100644 index 81e2098d..00000000 --- a/protos/google/cloud/tasks/v2beta3/cloudtasks.proto +++ /dev/null @@ -1,666 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta3; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/tasks/v2beta3/queue.proto"; -import "google/cloud/tasks/v2beta3/task.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasks"; -option java_multiple_files = true; -option java_outer_classname = "CloudTasksProto"; -option java_package = "com.google.cloud.tasks.v2beta3"; -option objc_class_prefix = "TASKS"; - -// Cloud Tasks allows developers to manage the execution of background -// work in their applications. -service CloudTasks { - option (google.api.default_host) = "cloudtasks.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists queues. - // - // Queues are returned in lexicographical order. - rpc ListQueues(ListQueuesRequest) returns (ListQueuesResponse) { - option (google.api.http) = { - get: "/v2beta3/{parent=projects/*/locations/*}/queues" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a queue. - rpc GetQueue(GetQueueRequest) returns (Queue) { - option (google.api.http) = { - get: "/v2beta3/{name=projects/*/locations/*/queues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a queue. - // - // Queues created with this method allow tasks to live for a maximum of 31 - // days. After a task is 31 days old, the task will be deleted regardless of whether - // it was dispatched or not. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc CreateQueue(CreateQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta3/{parent=projects/*/locations/*}/queues" - body: "queue" - }; - option (google.api.method_signature) = "parent,queue"; - } - - // Updates a queue. - // - // This method creates the queue if it does not exist and updates - // the queue if it does exist. - // - // Queues created with this method allow tasks to live for a maximum of 31 - // days. After a task is 31 days old, the task will be deleted regardless of whether - // it was dispatched or not. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc UpdateQueue(UpdateQueueRequest) returns (Queue) { - option (google.api.http) = { - patch: "/v2beta3/{queue.name=projects/*/locations/*/queues/*}" - body: "queue" - }; - option (google.api.method_signature) = "queue,update_mask"; - } - - // Deletes a queue. - // - // This command will delete the queue even if it has tasks in it. - // - // Note: If you delete a queue, a queue with the same name can't be created - // for 7 days. - // - // WARNING: Using this method may have unintended side effects if you are - // using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - // Read - // [Overview of Queue Management and - // queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - // this method. - rpc DeleteQueue(DeleteQueueRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2beta3/{name=projects/*/locations/*/queues/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Purges a queue by deleting all of its tasks. - // - // All tasks created before this method is called are permanently deleted. - // - // Purge operations can take up to one minute to take effect. Tasks - // might be dispatched before the purge takes effect. A purge is irreversible. - rpc PurgeQueue(PurgeQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta3/{name=projects/*/locations/*/queues/*}:purge" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Pauses the queue. - // - // If a queue is paused then the system will stop dispatching tasks - // until the queue is resumed via - // [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added - // when the queue is paused. A queue is paused if its - // [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - rpc PauseQueue(PauseQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta3/{name=projects/*/locations/*/queues/*}:pause" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Resume a queue. - // - // This method resumes a queue after it has been - // [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or - // [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored - // in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it - // will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING]. - // - // WARNING: Resuming many high-QPS queues at the same time can - // lead to target overloading. If you are resuming high-QPS - // queues, follow the 500/50/5 pattern described in - // [Managing Cloud Tasks Scaling - // Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - rpc ResumeQueue(ResumeQueueRequest) returns (Queue) { - option (google.api.http) = { - post: "/v2beta3/{name=projects/*/locations/*/queues/*}:resume" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. - // Returns an empty policy if the resource exists and does not have a policy - // set. - // - // Authorization requires the following - // [Google IAM](https://cloud.google.com/iam) permission on the specified - // resource parent: - // - // * `cloudtasks.queues.getIamPolicy` - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing - // policy. - // - // Note: The Cloud Console does not check queue-level IAM permissions yet. - // Project-level permissions are required to use the Cloud Console. - // - // Authorization requires the following - // [Google IAM](https://cloud.google.com/iam) permission on the specified - // resource parent: - // - // * `cloudtasks.queues.setIamPolicy` - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. - // If the resource does not exist, this will return an empty set of - // permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. - // - // Note: This operation is designed to be used for building permission-aware - // UIs and command-line tools, not for authorization checking. This operation - // may "fail open" without warning. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Lists the tasks in a queue. - // - // By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved - // due to performance considerations; - // [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the - // subset of information which is returned. - // - // The tasks may be returned in any order. The ordering may change at any - // time. - rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) { - option (google.api.http) = { - get: "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets a task. - rpc GetTask(GetTaskRequest) returns (Task) { - option (google.api.http) = { - get: "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a task and adds it to a queue. - // - // Tasks cannot be updated after creation; there is no UpdateTask command. - // - // * The maximum task size is 100KB. - rpc CreateTask(CreateTaskRequest) returns (Task) { - option (google.api.http) = { - post: "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks" - body: "*" - }; - option (google.api.method_signature) = "parent,task"; - } - - // Deletes a task. - // - // A task can be deleted if it is scheduled or dispatched. A task - // cannot be deleted if it has executed successfully or permanently - // failed. - rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Forces a task to run now. - // - // When this method is called, Cloud Tasks will dispatch the task, even if - // the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or - // is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - // - // This command is meant to be used for manual debugging. For - // example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed - // task after a fix has been made or to manually force a task to be - // dispatched now. - // - // The dispatched task is returned. That is, the task that is returned - // contains the [status][Task.status] after the task is dispatched but - // before the task is received by its target. - // - // If Cloud Tasks receives a successful response from the task's - // target, then the task will be deleted; otherwise the task's - // [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that - // [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified - // in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - // - // [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns - // [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a - // task that has already succeeded or permanently failed. - rpc RunTask(RunTaskRequest) returns (Task) { - option (google.api.http) = { - post: "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run" - body: "*" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues]. -message ListQueuesRequest { - // Required. The location name. - // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // `filter` can be used to specify a subset of queues. Any [Queue][google.cloud.tasks.v2beta3.Queue] - // field can be used as a filter and several operators as supported. - // For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - // described in - // [Stackdriver's Advanced Logs - // Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - // - // Sample filter "state: PAUSED". - // - // Note that using filters might cause fewer queues than the - // requested page_size to be returned. - string filter = 2; - - // Requested page size. - // - // The maximum page size is 9800. If unspecified, the page size will - // be the maximum. Fewer queues than requested might be returned, - // even if more queues exist; use the - // [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] in the - // response to determine if more queues exist. - int32 page_size = 3; - - // A token identifying the page of results to return. - // - // To request the first page results, page_token must be empty. To - // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token] returned - // from the previous call to [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] - // method. It is an error to switch the value of the - // [filter][google.cloud.tasks.v2beta3.ListQueuesRequest.filter] while iterating through pages. - string page_token = 4; - - // Optional. Read mask is used for a more granular control over what the API returns. - // If the mask is not present all fields will be returned except - // [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - // specified in the mask. - google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues]. -message ListQueuesResponse { - // The list of queues. - repeated Queue queues = 1; - - // A token to retrieve next page of results. - // - // To return the next page of results, call - // [ListQueues][google.cloud.tasks.v2beta3.CloudTasks.ListQueues] with this value as the - // [page_token][google.cloud.tasks.v2beta3.ListQueuesRequest.page_token]. - // - // If the next_page_token is empty, there are no more results. - // - // The page token is valid for only 2 hours. - string next_page_token = 2; -} - -// Request message for [GetQueue][google.cloud.tasks.v2beta3.CloudTasks.GetQueue]. -message GetQueueRequest { - // Required. The resource name of the queue. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // Optional. Read mask is used for a more granular control over what the API returns. - // If the mask is not present all fields will be returned except - // [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - // specified in the mask. - google.protobuf.FieldMask read_mask = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue]. -message CreateQueueRequest { - // Required. The location name in which the queue will be created. - // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - // - // The list of allowed locations can be obtained by calling Cloud - // Tasks' implementation of - // [ListLocations][google.cloud.location.Locations.ListLocations]. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Queue" - } - ]; - - // Required. The queue to create. - // - // [Queue's name][google.cloud.tasks.v2beta3.Queue.name] cannot be the same as an existing queue. - Queue queue = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue]. -message UpdateQueueRequest { - // Required. The queue to create or update. - // - // The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be specified. - // - // Output only fields cannot be modified using UpdateQueue. - // Any value specified for an output only field will be ignored. - // The queue's [name][google.cloud.tasks.v2beta3.Queue.name] cannot be changed. - Queue queue = 1 [(google.api.field_behavior) = REQUIRED]; - - // A mask used to specify which fields of the queue are being updated. - // - // If empty, then all fields will be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for [DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue]. -message DeleteQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue]. -message PurgeQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue]. -message PauseQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. -message ResumeQueueRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Queue" - } - ]; -} - -// Request message for listing tasks using [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks]. -message ListTasksRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. - Task.View response_view = 2; - - // Maximum page size. - // - // Fewer tasks than requested might be returned, even if more tasks exist; use - // [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] in the response to - // determine if more tasks exist. - // - // The maximum page size is 1000. If unspecified, the page size will be the - // maximum. - int32 page_size = 3; - - // A token identifying the page of results to return. - // - // To request the first page results, page_token must be empty. To - // request the next page of results, page_token must be the value of - // [next_page_token][google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token] returned - // from the previous call to [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] - // method. - // - // The page token is valid for only 2 hours. - string page_token = 4; -} - -// Response message for listing tasks using [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks]. -message ListTasksResponse { - // The list of tasks. - repeated Task tasks = 1; - - // A token to retrieve next page of results. - // - // To return the next page of results, call - // [ListTasks][google.cloud.tasks.v2beta3.CloudTasks.ListTasks] with this value as the - // [page_token][google.cloud.tasks.v2beta3.ListTasksRequest.page_token]. - // - // If the next_page_token is empty, there are no more results. - string next_page_token = 2; -} - -// Request message for getting a task using [GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. -message GetTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. - Task.View response_view = 2; -} - -// Request message for [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. -message CreateTaskRequest { - // Required. The queue name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - // - // The queue must already exist. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "cloudtasks.googleapis.com/Task" - } - ]; - - // Required. The task to add. - // - // Task names have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - // The user can optionally specify a task [name][google.cloud.tasks.v2beta3.Task.name]. If a - // name is not specified then the system will generate a random - // unique task id, which will be set in the task returned in the - // [response][google.cloud.tasks.v2beta3.Task.name]. - // - // If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not set or is in the - // past then Cloud Tasks will set it to the current time. - // - // Task De-duplication: - // - // Explicitly specifying a task ID enables task de-duplication. If - // a task's ID is identical to that of an existing task or a task - // that was deleted or executed recently then the call will fail - // with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS]. - // If the task's queue was created using Cloud Tasks, then another task with - // the same name can't be created for ~1hour after the original task was - // deleted or executed. If the task's queue was created using queue.yaml or - // queue.xml, then another task with the same name can't be created - // for ~9days after the original task was deleted or executed. - // - // Because there is an extra lookup cost to identify duplicate task - // names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] calls have significantly - // increased latency. Using hashed strings for the task id or for - // the prefix of the task id is recommended. Choosing task ids that - // are sequential or have sequential prefixes, for example using a - // timestamp, causes an increase in latency and error rates in all - // task commands. The infrastructure relies on an approximately - // uniform distribution of task ids to store and serve tasks - // efficiently. - Task task = 2 [(google.api.field_behavior) = REQUIRED]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. - Task.View response_view = 3; -} - -// Request message for deleting a task using -// [DeleteTask][google.cloud.tasks.v2beta3.CloudTasks.DeleteTask]. -message DeleteTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; -} - -// Request message for forcing a task to run now using -// [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask]. -message RunTaskRequest { - // Required. The task name. For example: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudtasks.googleapis.com/Task" - } - ]; - - // The response_view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] will be - // returned. - // - // By default response_view is [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - // - // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Task][google.cloud.tasks.v2beta3.Task] resource. - Task.View response_view = 2; -} diff --git a/protos/google/cloud/tasks/v2beta3/queue.proto b/protos/google/cloud/tasks/v2beta3/queue.proto deleted file mode 100644 index f892852b..00000000 --- a/protos/google/cloud/tasks/v2beta3/queue.proto +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta3; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/tasks/v2beta3/target.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasks"; -option java_multiple_files = true; -option java_outer_classname = "QueueProto"; -option java_package = "com.google.cloud.tasks.v2beta3"; - -// A queue is a container of related tasks. Queues are configured to manage -// how those tasks are dispatched. Configurable properties include rate limits, -// retry options, queue types, and others. -message Queue { - option (google.api.resource) = { - type: "cloudtasks.googleapis.com/Queue" - pattern: "projects/{project}/locations/{location}/queues/{queue}" - }; - - // State of the queue. - enum State { - // Unspecified state. - STATE_UNSPECIFIED = 0; - - // The queue is running. Tasks can be dispatched. - // - // If the queue was created using Cloud Tasks and the queue has - // had no activity (method calls or task dispatches) for 30 days, - // the queue may take a few minutes to re-activate. Some method - // calls may return [NOT_FOUND][google.rpc.Code.NOT_FOUND] and - // tasks may not be dispatched for a few minutes until the queue - // has been re-activated. - RUNNING = 1; - - // Tasks are paused by the user. If the queue is paused then Cloud - // Tasks will stop delivering tasks from it, but more tasks can - // still be added to it by the user. - PAUSED = 2; - - // The queue is disabled. - // - // A queue becomes `DISABLED` when - // [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref) - // or - // [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref) - // is uploaded which does not contain the queue. You cannot directly disable - // a queue. - // - // When a queue is disabled, tasks can still be added to a queue - // but the tasks are not dispatched. - // - // To permanently delete this queue and all of its tasks, call - // [DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue]. - DISABLED = 3; - } - - // The type of the queue. - enum Type { - // Default value. - TYPE_UNSPECIFIED = 0; - - // A pull queue. - PULL = 1; - - // A push queue. - PUSH = 2; - } - - // Caller-specified and required in [CreateQueue][google.cloud.tasks.v2beta3.CloudTasks.CreateQueue], - // after which it becomes output only. - // - // The queue name. - // - // The queue name must have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - // - // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), colons (:), or periods (.). - // For more information, see - // [Identifying - // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - // * `LOCATION_ID` is the canonical ID for the queue's location. - // The list of available locations can be obtained by calling - // [ListLocations][google.cloud.location.Locations.ListLocations]. - // For more information, see https://cloud.google.com/about/locations/. - // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - // hyphens (-). The maximum length is 100 characters. - string name = 1; - - oneof queue_type { - // [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] settings apply only to - // [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue. - // [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by this proto. - AppEngineHttpQueue app_engine_http_queue = 3; - } - - // Rate limits for task dispatches. - // - // [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] and [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] are - // related because they both control task attempts. However they control task - // attempts in different ways: - // - // * [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits] controls the total rate of - // dispatches from a queue (i.e. all traffic dispatched from the - // queue, regardless of whether the dispatch is from a first - // attempt or a retry). - // * [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls what happens to - // particular a task after its first attempt fails. That is, - // [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config] controls task retries (the - // second attempt, third attempt, etc). - // - // The queue's actual dispatch rate is the result of: - // - // * Number of tasks in the queue - // * User-specified throttling: [rate_limits][google.cloud.tasks.v2beta3.Queue.rate_limits], - // [retry_config][google.cloud.tasks.v2beta3.Queue.retry_config], and the - // [queue's state][google.cloud.tasks.v2beta3.Queue.state]. - // * System throttling due to `429` (Too Many Requests) or `503` (Service - // Unavailable) responses from the worker, high error rates, or to smooth - // sudden large traffic spikes. - RateLimits rate_limits = 4; - - // Settings that determine the retry behavior. - // - // * For tasks created using Cloud Tasks: the queue-level retry settings - // apply to all tasks in the queue that were created using Cloud Tasks. - // Retry settings cannot be set on individual tasks. - // * For tasks created using the App Engine SDK: the queue-level retry - // settings apply to all tasks in the queue which do not have retry settings - // explicitly set on the task and were created by the App Engine SDK. See - // [App Engine - // documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - RetryConfig retry_config = 5; - - // Output only. The state of the queue. - // - // `state` can only be changed by calling - // [PauseQueue][google.cloud.tasks.v2beta3.CloudTasks.PauseQueue], - // [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue], or uploading - // [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref). - // [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] cannot be used to change `state`. - State state = 6; - - // Output only. The last time this queue was purged. - // - // All tasks that were [created][google.cloud.tasks.v2beta3.Task.create_time] before this time - // were purged. - // - // A queue can be purged using [PurgeQueue][google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue], the - // [App Engine Task Queue SDK, or the Cloud - // Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - // - // Purge time will be truncated to the nearest microsecond. Purge - // time will be unset if the queue has never been purged. - google.protobuf.Timestamp purge_time = 7; - - // The maximum amount of time that a task will be retained in - // this queue. - // - // Queues created by Cloud Tasks have a default `task_ttl` of 31 days. - // After a task has lived for `task_ttl`, the task will be deleted - // regardless of whether it was dispatched or not. - // - // The `task_ttl` for queues created via queue.yaml/xml is equal to the - // maximum duration because there is a - // [storage quota](https://cloud.google.com/appengine/quotas#Task_Queue) for - // these queues. To view the maximum valid duration, see the documentation for - // [Duration][google.protobuf.Duration]. - google.protobuf.Duration task_ttl = 8; - - // The task tombstone time to live (TTL). - // - // After a task is deleted or executed, the task's tombstone is - // retained for the length of time specified by `tombstone_ttl`. - // The tombstone is used by task de-duplication; another task with the same - // name can't be created until the tombstone has expired. For more information - // about task de-duplication, see the documentation for - // [CreateTaskRequest][google.cloud.tasks.v2beta3.CreateTaskRequest.task]. - // - // Queues created by Cloud Tasks have a default `tombstone_ttl` of 1 hour. - google.protobuf.Duration tombstone_ttl = 9; - - // Configuration options for writing logs to - // [Stackdriver Logging](https://cloud.google.com/logging/docs/). If this - // field is unset, then no logs are written. - StackdriverLoggingConfig stackdriver_logging_config = 10; - - // Immutable. The type of a queue (push or pull). - // - // `Queue.type` is an immutable property of the queue that is set at the queue - // creation time. When left unspecified, the default value of `PUSH` is - // selected. - Type type = 11 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The realtime, informational statistics for a queue. In order - // to receive the statistics the caller should include this field in the - // FieldMask. - QueueStats stats = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Rate limits. -// -// This message determines the maximum rate that tasks can be dispatched by a -// queue, regardless of whether the dispatch is a first task attempt or a retry. -// -// Note: The debugging command, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask], will run a task -// even if the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits]. -message RateLimits { - // The maximum rate at which tasks are dispatched from this queue. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // * For [App Engine queues][google.cloud.tasks.v2beta3.AppEngineHttpQueue], the maximum allowed value - // is 500. - // - // - // This field has the same meaning as - // [rate in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). - double max_dispatches_per_second = 1; - - // The max burst size. - // - // Max burst size limits how fast tasks in queue are processed when - // many tasks are in the queue and the rate is high. This field - // allows the queue to have a high rate so processing starts shortly - // after a task is enqueued, but still limits resource usage when - // many tasks are enqueued in a short period of time. - // - // The [token bucket](https://wikipedia.org/wiki/Token_Bucket) - // algorithm is used to control the rate of task dispatches. Each - // queue has a token bucket that holds tokens, up to the maximum - // specified by `max_burst_size`. Each time a task is dispatched, a - // token is removed from the bucket. Tasks will be dispatched until - // the queue's bucket runs out of tokens. The bucket will be - // continuously refilled with new tokens based on - // [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - // - // The default value of `max_burst_size` is picked by Cloud Tasks - // based on the value of - // [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - // - // The maximum value of `max_burst_size` is 500. - // - // For App Engine queues that were created or updated using - // `queue.yaml/xml`, `max_burst_size` is equal to - // [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). - // If - // [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is called on a queue without - // explicitly setting a value for `max_burst_size`, - // `max_burst_size` value will get updated if - // [UpdateQueue][google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue] is updating - // [max_dispatches_per_second][google.cloud.tasks.v2beta3.RateLimits.max_dispatches_per_second]. - // - int32 max_burst_size = 2; - - // The maximum number of concurrent tasks that Cloud Tasks allows - // to be dispatched for this queue. After this threshold has been - // reached, Cloud Tasks stops dispatching tasks until the number of - // concurrent requests decreases. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // The maximum allowed value is 5,000. - // - // - // This field has the same meaning as - // [max_concurrent_requests in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - int32 max_concurrent_dispatches = 3; -} - -// Retry config. -// -// These settings determine when a failed task attempt is retried. -message RetryConfig { - // Number of attempts per task. - // - // Cloud Tasks will attempt the task `max_attempts` times (that is, if the - // first attempt fails, then there will be `max_attempts - 1` retries). Must - // be >= -1. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // -1 indicates unlimited attempts. - // - // This field has the same meaning as - // [task_retry_limit in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - int32 max_attempts = 1; - - // If positive, `max_retry_duration` specifies the time limit for - // retrying a failed task, measured from when the task was first - // attempted. Once `max_retry_duration` time has passed *and* the - // task has been attempted [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] - // times, no further attempts will be made and the task will be - // deleted. - // - // If zero, then the task age is unlimited. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // `max_retry_duration` will be truncated to the nearest second. - // - // This field has the same meaning as - // [task_age_limit in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration max_retry_duration = 2; - - // A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] for retry between - // [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - // [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration after it fails, - // if the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the task should be - // retried. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // `min_backoff` will be truncated to the nearest second. - // - // This field has the same meaning as - // [min_backoff_seconds in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration min_backoff = 3; - - // A task will be [scheduled][google.cloud.tasks.v2beta3.Task.schedule_time] for retry between - // [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] and - // [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] duration after it fails, - // if the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig] specifies that the task should be - // retried. - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // `max_backoff` will be truncated to the nearest second. - // - // This field has the same meaning as - // [max_backoff_seconds in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - google.protobuf.Duration max_backoff = 4; - - // The time between retries will double `max_doublings` times. - // - // A task's retry interval starts at - // [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff], then doubles - // `max_doublings` times, then increases linearly, and finally - // retries at intervals of - // [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] up to - // [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] times. - // - // For example, if [min_backoff][google.cloud.tasks.v2beta3.RetryConfig.min_backoff] is 10s, - // [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] is 300s, and - // `max_doublings` is 3, then the a task will first be retried in - // 10s. The retry interval will double three times, and then - // increase linearly by 2^3 * 10s. Finally, the task will retry at - // intervals of [max_backoff][google.cloud.tasks.v2beta3.RetryConfig.max_backoff] until the - // task has been attempted [max_attempts][google.cloud.tasks.v2beta3.RetryConfig.max_attempts] - // times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, - // 240s, 300s, 300s, .... - // - // If unspecified when the queue is created, Cloud Tasks will pick the - // default. - // - // - // This field has the same meaning as - // [max_doublings in - // queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters). - int32 max_doublings = 5; -} - -// Configuration options for writing logs to -// [Stackdriver Logging](https://cloud.google.com/logging/docs/). -message StackdriverLoggingConfig { - // Specifies the fraction of operations to write to - // [Stackdriver Logging](https://cloud.google.com/logging/docs/). - // This field may contain any value between 0.0 and 1.0, inclusive. - // 0.0 is the default and means that no operations are logged. - double sampling_ratio = 1; -} - -// Statistics for a queue. -message QueueStats { - // Output only. An estimation of the number of tasks in the queue, that is, the tasks in - // the queue that haven't been executed, the tasks in the queue which the - // queue has dispatched but has not yet received a reply for, and the failed - // tasks that the queue is retrying. - int64 tasks_count = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. An estimation of the nearest time in the future where a task in the queue - // is scheduled to be executed. - google.protobuf.Timestamp oldest_estimated_arrival_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of tasks that the queue has dispatched and received a reply for - // during the last minute. This variable counts both successful and - // non-successful executions. - int64 executed_last_minute_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The number of requests that the queue has dispatched but has not received - // a reply for yet. - int64 concurrent_dispatches_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current maximum number of tasks per second executed by the queue. - // The maximum value of this variable is controlled by the RateLimits of the - // Queue. However, this value could be less to avoid overloading the endpoints - // tasks in the queue are targeting. - double effective_execution_rate = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/protos/google/cloud/tasks/v2beta3/target.proto b/protos/google/cloud/tasks/v2beta3/target.proto deleted file mode 100644 index efebfedf..00000000 --- a/protos/google/cloud/tasks/v2beta3/target.proto +++ /dev/null @@ -1,459 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta3; - - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasks"; -option java_multiple_files = true; -option java_outer_classname = "TargetProto"; -option java_package = "com.google.cloud.tasks.v2beta3"; - -// Pull Message. -// -// This proto can only be used for tasks in a queue which has -// [PULL][google.cloud.tasks.v2beta3.Queue.type] type. It currently exists for backwards compatibility with -// the App Engine Task Queue SDK. This message type maybe returned with methods -// [list][google.cloud.tasks.v2beta3.CloudTask.ListTasks] and -// [get][google.cloud.tasks.v2beta3.CloudTask.ListTasks], when the response view -// is [FULL][google.cloud.tasks.v2beta3.Task.View.Full]. -message PullMessage { - // A data payload consumed by the worker to execute the task. - bytes payload = 1; - - // The tasks's tag. - // - // The tag is less than 500 characters. - // - // SDK compatibility: Although the SDK allows tags to be either - // string or - // [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - // only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 - // encoded, the tag will be empty when the task is returned by Cloud Tasks. - string tag = 2; -} - -// HTTP request. -// -// The task will be pushed to the worker as an HTTP request. If the worker -// or the redirected worker acknowledges the task by returning a successful HTTP -// response code ([`200` - `299`]), the task will be removed from the queue. If -// any other HTTP response code is returned or no response is received, the -// task will be retried according to the following: -// -// * User-specified throttling: [retry configuration][google.cloud.tasks.v2beta3.Queue.retry_config], -// [rate limits][google.cloud.tasks.v2beta3.Queue.rate_limits], and the [queue's state][google.cloud.tasks.v2beta3.Queue.state]. -// -// * System throttling: To prevent the worker from overloading, Cloud Tasks may -// temporarily reduce the queue's effective rate. User-specified settings -// will not be changed. -// -// System throttling happens because: -// -// * Cloud Tasks backs off on all errors. Normally the backoff specified in -// [rate limits][google.cloud.tasks.v2beta3.Queue.rate_limits] will be used. But if the worker returns -// `429` (Too Many Requests), `503` (Service Unavailable), or the rate of -// errors is high, Cloud Tasks will use a higher backoff rate. The retry -// specified in the `Retry-After` HTTP response header is considered. -// -// * To prevent traffic spikes and to smooth sudden increases in traffic, -// dispatches ramp up slowly when the queue is newly created or idle and -// if large numbers of tasks suddenly become available to dispatch (due to -// spikes in create task rates, the queue being unpaused, or many tasks -// that are scheduled at the same time). -message HttpRequest { - // Required. The full url path that the request will be sent to. - // - // This string must begin with either "http://" or "https://". Some examples - // are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will - // encode some characters for safety and compatibility. The maximum allowed - // URL length is 2083 characters after encoding. - // - // The `Location` header response from a redirect response [`300` - `399`] - // may be followed. The redirect is not counted as a separate attempt. - string url = 1; - - // The HTTP method to use for the request. The default is POST. - HttpMethod http_method = 2; - - // HTTP request headers. - // - // This map contains the header field names and values. - // Headers can be set when the - // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // - // These headers represent a subset of the headers that will accompany the - // task's HTTP request. Some HTTP request headers will be ignored or replaced. - // - // A partial list of headers that will be ignored or replaced is: - // - // * Host: This will be computed by Cloud Tasks and derived from - // [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. - // * Content-Length: This will be computed by Cloud Tasks. - // * User-Agent: This will be set to `"Google-Cloud-Tasks"`. - // * `X-Google-*`: Google use only. - // * `X-AppEngine-*`: Google use only. - // - // `Content-Type` won't be set by Cloud Tasks. You can explicitly set - // `Content-Type` to a media type when the - // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // For example, `Content-Type` can be set to `"application/octet-stream"` or - // `"application/json"`. - // - // Headers which can have multiple values (according to RFC2616) can be - // specified using comma-separated values. - // - // The size of the headers must be less than 80KB. - map headers = 3; - - // HTTP request body. - // - // A request body is allowed only if the - // [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, PUT, or PATCH. It is an - // error to set body on a task with an incompatible [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - bytes body = 4; - - // The mode for generating an `Authorization` header for HTTP requests. - // - // If specified, all `Authorization` headers in the [HttpRequest.headers][google.cloud.tasks.v2beta3.HttpRequest.headers] - // field will be overridden. - oneof authorization_header { - // If specified, an - // [OAuth token](https://developers.google.com/identity/protocols/OAuth2) - // will be generated and attached as an `Authorization` header in the HTTP - // request. - // - // This type of authorization should generally only be used when calling - // Google APIs hosted on *.googleapis.com. - OAuthToken oauth_token = 5; - - // If specified, an - // [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) - // token will be generated and attached as an `Authorization` header in the - // HTTP request. - // - // This type of authorization can be used for many scenarios, including - // calling Cloud Run, or endpoints where you intend to validate the token - // yourself. - OidcToken oidc_token = 6; - } -} - -// App Engine HTTP queue. -// -// The task will be delivered to the App Engine application hostname -// specified by its [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] and [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest]. -// The documentation for [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] explains how the -// task's host URL is constructed. -// -// Using [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] requires -// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -// Google IAM permission for the project -// and the following scope: -// -// `https://www.googleapis.com/auth/cloud-platform` -message AppEngineHttpQueue { - // Overrides for the - // [task-level app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - // - // If set, `app_engine_routing_override` is used for all tasks in - // the queue, no matter what the setting is for the - // [task-level app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - AppEngineRouting app_engine_routing_override = 1; -} - -// App Engine HTTP request. -// -// The message defines the HTTP request that is sent to an App Engine app when -// the task is dispatched. -// -// Using [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] requires -// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) -// Google IAM permission for the project -// and the following scope: -// -// `https://www.googleapis.com/auth/cloud-platform` -// -// The task will be delivered to the App Engine app which belongs to the same -// project as the queue. For more information, see -// [How Requests are -// Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) -// and how routing is affected by -// [dispatch -// files](https://cloud.google.com/appengine/docs/python/config/dispatchref). -// Traffic is encrypted during transport and never leaves Google datacenters. -// Because this traffic is carried over a communication mechanism internal to -// Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). -// The request to the handler, however, will appear to have used the HTTP -// protocol. -// -// The [AppEngineRouting][google.cloud.tasks.v2beta3.AppEngineRouting] used to construct the URL that the task is -// delivered to can be set at the queue-level or task-level: -// -// * If set, -// [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] -// is used for all tasks in the queue, no matter what the setting -// is for the -// [task-level app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. -// -// -// The `url` that the task will be sent to is: -// -// * `url =` [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] `+` -// [relative_uri][google.cloud.tasks.v2beta3.AppEngineHttpRequest.relative_uri] -// -// Tasks can be dispatched to secure app handlers, unsecure app handlers, and -// URIs restricted with -// [`login: -// admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). -// Because tasks are not run as any user, they cannot be dispatched to URIs -// restricted with -// [`login: -// required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) -// Task dispatches also do not follow redirects. -// -// The task attempt has succeeded if the app's request handler returns an HTTP -// response code in the range [`200` - `299`]. The task attempt has failed if -// the app's handler returns a non-2xx response code or Cloud Tasks does -// not receive response before the [deadline][google.cloud.tasks.v2beta3.Task.dispatch_deadline]. Failed -// tasks will be retried according to the -// [retry configuration][google.cloud.tasks.v2beta3.Queue.retry_config]. `503` (Service Unavailable) is -// considered an App Engine system error instead of an application error and -// will cause Cloud Tasks' traffic congestion control to temporarily throttle -// the queue's dispatches. Unlike other types of task targets, a `429` (Too Many -// Requests) response from an app handler does not cause traffic congestion -// control to throttle the queue. -message AppEngineHttpRequest { - // The HTTP method to use for the request. The default is POST. - // - // The app's request handler for the task's target URL must be able to handle - // HTTP requests with this http_method, otherwise the task attempt fails with - // error code 405 (Method Not Allowed). See [Writing a push task request - // handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - // and the App Engine documentation for your runtime on [How Requests are - // Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). - HttpMethod http_method = 1; - - // Task-level setting for App Engine routing. - // - // If set, - // [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] - // is used for all tasks in the queue, no matter what the setting is for the - // [task-level app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. - AppEngineRouting app_engine_routing = 2; - - // The relative URI. - // - // The relative URI must begin with "/" and must be a valid HTTP relative URI. - // It can contain a path and query string arguments. - // If the relative URI is empty, then the root path "/" will be used. - // No spaces are allowed, and the maximum length allowed is 2083 characters. - string relative_uri = 3; - - // HTTP request headers. - // - // This map contains the header field names and values. - // Headers can be set when the - // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // Repeated headers are not supported but a header value can contain commas. - // - // Cloud Tasks sets some headers to default values: - // - // * `User-Agent`: By default, this header is - // `"AppEngine-Google; (+http://code.google.com/appengine)"`. - // This header can be modified, but Cloud Tasks will append - // `"AppEngine-Google; (+http://code.google.com/appengine)"` to the - // modified `User-Agent`. - // - // If the task has a [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud - // Tasks sets the following headers: - // - // * `Content-Type`: By default, the `Content-Type` header is set to - // `"application/octet-stream"`. The default can be overridden by explicitly - // setting `Content-Type` to a particular media type when the - // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // For example, `Content-Type` can be set to `"application/json"`. - // * `Content-Length`: This is computed by Cloud Tasks. This value is - // output only. It cannot be changed. - // - // The headers below cannot be set or overridden: - // - // * `Host` - // * `X-Google-*` - // * `X-AppEngine-*` - // - // In addition, Cloud Tasks sets some headers when the task is dispatched, - // such as headers containing information about the task; see - // [request - // headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). - // These headers are set only when the task is dispatched, so they are not - // visible when the task is returned in a Cloud Tasks response. - // - // Although there is no specific limit for the maximum number of headers or - // the size, there is a limit on the maximum size of the [Task][google.cloud.tasks.v2beta3.Task]. For more - // information, see the [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] documentation. - map headers = 4; - - // HTTP request body. - // - // A request body is allowed only if the HTTP method is POST or PUT. It is - // an error to set a body on a task with an incompatible [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. - bytes body = 5; -} - -// App Engine Routing. -// -// Defines routing characteristics specific to App Engine - service, version, -// and instance. -// -// For more information about services, versions, and instances see -// [An Overview of App -// Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), -// [Microservices Architecture on Google App -// Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), -// [App Engine Standard request -// routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), -// and [App Engine Flex request -// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). -message AppEngineRouting { - // App service. - // - // By default, the task is sent to the service which is the default - // service when the task is attempted. - // - // For some queues or tasks which were created using the App Engine - // Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable - // into [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For example, some tasks - // which were created using the App Engine SDK use a custom domain - // name; custom domains are not parsed by Cloud Tasks. If - // [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, then - // [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the empty string. - string service = 1; - - // App version. - // - // By default, the task is sent to the version which is the default - // version when the task is attempted. - // - // For some queues or tasks which were created using the App Engine - // Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable - // into [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For example, some tasks - // which were created using the App Engine SDK use a custom domain - // name; custom domains are not parsed by Cloud Tasks. If - // [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, then - // [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], - // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and - // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the empty string. - string version = 2; - - // App instance. - // - // By default, the task is sent to an instance which is available when - // the task is attempted. - // - // Requests can only be sent to a specific instance if - // [manual scaling is used in App Engine - // Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - // App Engine Flex does not support instances. For more information, see - // [App Engine Standard request - // routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) - // and [App Engine Flex request - // routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). - string instance = 3; - - // Output only. The host that the task is sent to. - // - // The host is constructed from the domain name of the app associated with - // the queue's project ID (for example .appspot.com), and the - // [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], - // and [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks which were created using - // the App Engine SDK might have a custom domain name. - // - // For more information, see - // [How Requests are - // Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). - string host = 4; -} - -// The HTTP method used to execute the task. -enum HttpMethod { - // HTTP method unspecified - HTTP_METHOD_UNSPECIFIED = 0; - - // HTTP POST - POST = 1; - - // HTTP GET - GET = 2; - - // HTTP HEAD - HEAD = 3; - - // HTTP PUT - PUT = 4; - - // HTTP DELETE - DELETE = 5; - - // HTTP PATCH - PATCH = 6; - - // HTTP OPTIONS - OPTIONS = 7; -} - -// Contains information needed for generating an -// [OAuth token](https://developers.google.com/identity/protocols/OAuth2). -// This type of authorization should generally only be used when calling Google -// APIs hosted on *.googleapis.com. -message OAuthToken { - // [Service account email](https://cloud.google.com/iam/docs/service-accounts) - // to be used for generating OAuth token. - // The service account must be within the same project as the queue. The - // caller must have iam.serviceAccounts.actAs permission for the service - // account. - string service_account_email = 1; - - // OAuth scope to be used for generating OAuth access token. - // If not specified, "https://www.googleapis.com/auth/cloud-platform" - // will be used. - string scope = 2; -} - -// Contains information needed for generating an -// [OpenID Connect -// token](https://developers.google.com/identity/protocols/OpenIDConnect). -// This type of authorization can be used for many scenarios, including -// calling Cloud Run, or endpoints where you intend to validate the token -// yourself. -message OidcToken { - // [Service account email](https://cloud.google.com/iam/docs/service-accounts) - // to be used for generating OIDC token. - // The service account must be within the same project as the queue. The - // caller must have iam.serviceAccounts.actAs permission for the service - // account. - string service_account_email = 1; - - // Audience to be used when generating OIDC token. If not specified, the URI - // specified in target will be used. - string audience = 2; -} diff --git a/protos/google/cloud/tasks/v2beta3/task.proto b/protos/google/cloud/tasks/v2beta3/task.proto deleted file mode 100644 index b491b5aa..00000000 --- a/protos/google/cloud/tasks/v2beta3/task.proto +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.tasks.v2beta3; - -import "google/api/resource.proto"; -import "google/cloud/tasks/v2beta3/target.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasks"; -option java_multiple_files = true; -option java_outer_classname = "TaskProto"; -option java_package = "com.google.cloud.tasks.v2beta3"; - -// A unit of scheduled work. -message Task { - option (google.api.resource) = { - type: "cloudtasks.googleapis.com/Task" - pattern: "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" - }; - - // The view specifies a subset of [Task][google.cloud.tasks.v2beta3.Task] data. - // - // When a task is returned in a response, not all - // information is retrieved by default because some data, such as - // payloads, might be desirable to return only when needed because - // of its large size or because of the sensitivity of data that it - // contains. - enum View { - // Unspecified. Defaults to BASIC. - VIEW_UNSPECIFIED = 0; - - // The basic view omits fields which can be large or can contain - // sensitive data. - // - // This view does not include the - // [body in AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. - // Bodies are desirable to return only when needed, because they - // can be large and because of the sensitivity of the data that you - // choose to store in it. - BASIC = 1; - - // All information is returned. - // - // Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires - // `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - // permission on the [Queue][google.cloud.tasks.v2beta3.Queue] resource. - FULL = 2; - } - - // Optionally caller-specified in [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. - // - // The task name. - // - // The task name must have the following format: - // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - // - // * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), colons (:), or periods (.). - // For more information, see - // [Identifying - // projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) - // * `LOCATION_ID` is the canonical ID for the task's location. - // The list of available locations can be obtained by calling - // [ListLocations][google.cloud.location.Locations.ListLocations]. - // For more information, see https://cloud.google.com/about/locations/. - // * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or - // hyphens (-). The maximum length is 100 characters. - // * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), - // hyphens (-), or underscores (_). The maximum length is 500 characters. - string name = 1; - - // Required. The message to send to the worker. - oneof payload_type { - // HTTP request that is sent to the App Engine app handler. - // - // An App Engine task is a task that has [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] set. - AppEngineHttpRequest app_engine_http_request = 3; - - // HTTP request that is sent to the task's target. - // - // An HTTP task is a task that has [HttpRequest][google.cloud.tasks.v2beta3.HttpRequest] set. - HttpRequest http_request = 11; - - // Pull Message contained in a task in a [PULL][google.cloud.tasks.v2beta3.Queue.type] queue type. This - // payload type cannot be explicitly set through Cloud Tasks API. Its - // purpose, currently is to provide backward compatibility with App Engine - // Task Queue - // [pull](https://cloud.google.com/appengine/docs/standard/java/taskqueue/pull/) - // queues to provide a way to inspect contents of pull tasks through the - // [CloudTasks.GetTask][google.cloud.tasks.v2beta3.CloudTasks.GetTask]. - PullMessage pull_message = 13; - } - - // The time when the task is scheduled to be attempted. - // - // For App Engine queues, this is when the task will be attempted or retried. - // - // `schedule_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp schedule_time = 4; - - // Output only. The time that the task was created. - // - // `create_time` will be truncated to the nearest second. - google.protobuf.Timestamp create_time = 5; - - // The deadline for requests sent to the worker. If the worker does not - // respond by this deadline then the request is cancelled and the attempt - // is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the - // task according to the [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. - // - // Note that when the request is cancelled, Cloud Tasks will stop listening - // for the response, but whether the worker stops processing depends on the - // worker. For example, if the worker is stuck, it may not react to cancelled - // requests. - // - // The default and maximum values depend on the type of request: - // - // * For [HTTP tasks][google.cloud.tasks.v2beta3.HttpRequest], the default is 10 minutes. The deadline - // must be in the interval [15 seconds, 30 minutes]. - // - // * For [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest], 0 indicates that the - // request has the default deadline. The default deadline depends on the - // [scaling - // type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) - // of the service: 10 minutes for standard apps with automatic scaling, 24 - // hours for standard apps with manual and basic scaling, and 60 minutes for - // flex apps. If the request deadline is set, it must be in the interval [15 - // seconds, 24 hours 15 seconds]. Regardless of the task's - // `dispatch_deadline`, the app handler will not run for longer than than - // the service's timeout. We recommend setting the `dispatch_deadline` to - // at most a few seconds more than the app handler's timeout. For more - // information see - // [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). - // - // `dispatch_deadline` will be truncated to the nearest millisecond. The - // deadline is an approximate deadline. - google.protobuf.Duration dispatch_deadline = 12; - - // Output only. The number of attempts dispatched. - // - // This count includes attempts which have been dispatched but haven't - // received a response. - int32 dispatch_count = 6; - - // Output only. The number of attempts which have received a response. - int32 response_count = 7; - - // Output only. The status of the task's first attempt. - // - // Only [dispatch_time][google.cloud.tasks.v2beta3.Attempt.dispatch_time] will be set. - // The other [Attempt][google.cloud.tasks.v2beta3.Attempt] information is not retained by Cloud Tasks. - Attempt first_attempt = 8; - - // Output only. The status of the task's last attempt. - Attempt last_attempt = 9; - - // Output only. The view specifies which subset of the [Task][google.cloud.tasks.v2beta3.Task] has - // been returned. - View view = 10; -} - -// The status of a task attempt. -message Attempt { - // Output only. The time that this attempt was scheduled. - // - // `schedule_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp schedule_time = 1; - - // Output only. The time that this attempt was dispatched. - // - // `dispatch_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp dispatch_time = 2; - - // Output only. The time that this attempt response was received. - // - // `response_time` will be truncated to the nearest microsecond. - google.protobuf.Timestamp response_time = 3; - - // Output only. The response from the worker for this attempt. - // - // If `response_time` is unset, then the task has not been attempted or is - // currently running and the `response_status` field is meaningless. - google.rpc.Status response_status = 4; -} diff --git a/protos/protos.d.ts b/protos/protos.d.ts deleted file mode 100644 index 6751b047..00000000 --- a/protos/protos.d.ts +++ /dev/null @@ -1,16970 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace cloud. */ - namespace cloud { - - /** Namespace tasks. */ - namespace tasks { - - /** Namespace v2. */ - namespace v2 { - - /** Represents a CloudTasks */ - class CloudTasks extends $protobuf.rpc.Service { - - /** - * Constructs a new CloudTasks 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 CloudTasks 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): CloudTasks; - - /** - * Calls ListQueues. - * @param request ListQueuesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListQueuesResponse - */ - public listQueues(request: google.cloud.tasks.v2.IListQueuesRequest, callback: google.cloud.tasks.v2.CloudTasks.ListQueuesCallback): void; - - /** - * Calls ListQueues. - * @param request ListQueuesRequest message or plain object - * @returns Promise - */ - public listQueues(request: google.cloud.tasks.v2.IListQueuesRequest): Promise; - - /** - * Calls GetQueue. - * @param request GetQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public getQueue(request: google.cloud.tasks.v2.IGetQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.GetQueueCallback): void; - - /** - * Calls GetQueue. - * @param request GetQueueRequest message or plain object - * @returns Promise - */ - public getQueue(request: google.cloud.tasks.v2.IGetQueueRequest): Promise; - - /** - * Calls CreateQueue. - * @param request CreateQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public createQueue(request: google.cloud.tasks.v2.ICreateQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.CreateQueueCallback): void; - - /** - * Calls CreateQueue. - * @param request CreateQueueRequest message or plain object - * @returns Promise - */ - public createQueue(request: google.cloud.tasks.v2.ICreateQueueRequest): Promise; - - /** - * Calls UpdateQueue. - * @param request UpdateQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public updateQueue(request: google.cloud.tasks.v2.IUpdateQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.UpdateQueueCallback): void; - - /** - * Calls UpdateQueue. - * @param request UpdateQueueRequest message or plain object - * @returns Promise - */ - public updateQueue(request: google.cloud.tasks.v2.IUpdateQueueRequest): Promise; - - /** - * Calls DeleteQueue. - * @param request DeleteQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteQueue(request: google.cloud.tasks.v2.IDeleteQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.DeleteQueueCallback): void; - - /** - * Calls DeleteQueue. - * @param request DeleteQueueRequest message or plain object - * @returns Promise - */ - public deleteQueue(request: google.cloud.tasks.v2.IDeleteQueueRequest): Promise; - - /** - * Calls PurgeQueue. - * @param request PurgeQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public purgeQueue(request: google.cloud.tasks.v2.IPurgeQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.PurgeQueueCallback): void; - - /** - * Calls PurgeQueue. - * @param request PurgeQueueRequest message or plain object - * @returns Promise - */ - public purgeQueue(request: google.cloud.tasks.v2.IPurgeQueueRequest): Promise; - - /** - * Calls PauseQueue. - * @param request PauseQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public pauseQueue(request: google.cloud.tasks.v2.IPauseQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.PauseQueueCallback): void; - - /** - * Calls PauseQueue. - * @param request PauseQueueRequest message or plain object - * @returns Promise - */ - public pauseQueue(request: google.cloud.tasks.v2.IPauseQueueRequest): Promise; - - /** - * Calls ResumeQueue. - * @param request ResumeQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public resumeQueue(request: google.cloud.tasks.v2.IResumeQueueRequest, callback: google.cloud.tasks.v2.CloudTasks.ResumeQueueCallback): void; - - /** - * Calls ResumeQueue. - * @param request ResumeQueueRequest message or plain object - * @returns Promise - */ - public resumeQueue(request: google.cloud.tasks.v2.IResumeQueueRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.tasks.v2.CloudTasks.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.tasks.v2.CloudTasks.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.tasks.v2.CloudTasks.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.tasks.v2.IListTasksRequest, callback: google.cloud.tasks.v2.CloudTasks.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.tasks.v2.IListTasksRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.tasks.v2.IGetTaskRequest, callback: google.cloud.tasks.v2.CloudTasks.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.tasks.v2.IGetTaskRequest): Promise; - - /** - * Calls CreateTask. - * @param request CreateTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public createTask(request: google.cloud.tasks.v2.ICreateTaskRequest, callback: google.cloud.tasks.v2.CloudTasks.CreateTaskCallback): void; - - /** - * Calls CreateTask. - * @param request CreateTaskRequest message or plain object - * @returns Promise - */ - public createTask(request: google.cloud.tasks.v2.ICreateTaskRequest): Promise; - - /** - * Calls DeleteTask. - * @param request DeleteTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTask(request: google.cloud.tasks.v2.IDeleteTaskRequest, callback: google.cloud.tasks.v2.CloudTasks.DeleteTaskCallback): void; - - /** - * Calls DeleteTask. - * @param request DeleteTaskRequest message or plain object - * @returns Promise - */ - public deleteTask(request: google.cloud.tasks.v2.IDeleteTaskRequest): Promise; - - /** - * Calls RunTask. - * @param request RunTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public runTask(request: google.cloud.tasks.v2.IRunTaskRequest, callback: google.cloud.tasks.v2.CloudTasks.RunTaskCallback): void; - - /** - * Calls RunTask. - * @param request RunTaskRequest message or plain object - * @returns Promise - */ - public runTask(request: google.cloud.tasks.v2.IRunTaskRequest): Promise; - } - - namespace CloudTasks { - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|listQueues}. - * @param error Error, if any - * @param [response] ListQueuesResponse - */ - type ListQueuesCallback = (error: (Error|null), response?: google.cloud.tasks.v2.ListQueuesResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|getQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type GetQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|createQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type CreateQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|updateQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type UpdateQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|deleteQueue}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteQueueCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|purgeQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type PurgeQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|pauseQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type PauseQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|resumeQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type ResumeQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.tasks.v2.ListTasksResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|createTask}. - * @param error Error, if any - * @param [response] Task - */ - type CreateTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|deleteTask}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteTaskCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|runTask}. - * @param error Error, if any - * @param [response] Task - */ - type RunTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2.Task) => void; - } - - /** Properties of a ListQueuesRequest. */ - interface IListQueuesRequest { - - /** ListQueuesRequest parent */ - parent?: (string|null); - - /** ListQueuesRequest filter */ - filter?: (string|null); - - /** ListQueuesRequest pageSize */ - pageSize?: (number|null); - - /** ListQueuesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListQueuesRequest. */ - class ListQueuesRequest implements IListQueuesRequest { - - /** - * Constructs a new ListQueuesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IListQueuesRequest); - - /** ListQueuesRequest parent. */ - public parent: string; - - /** ListQueuesRequest filter. */ - public filter: string; - - /** ListQueuesRequest pageSize. */ - public pageSize: number; - - /** ListQueuesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListQueuesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListQueuesRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IListQueuesRequest): google.cloud.tasks.v2.ListQueuesRequest; - - /** - * Encodes the specified ListQueuesRequest message. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesRequest.verify|verify} messages. - * @param message ListQueuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IListQueuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListQueuesRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesRequest.verify|verify} messages. - * @param message ListQueuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IListQueuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.ListQueuesRequest; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.ListQueuesRequest; - - /** - * Verifies a ListQueuesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListQueuesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListQueuesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.ListQueuesRequest; - - /** - * Creates a plain object from a ListQueuesRequest message. Also converts values to other types if specified. - * @param message ListQueuesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.ListQueuesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListQueuesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListQueuesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListQueuesResponse. */ - interface IListQueuesResponse { - - /** ListQueuesResponse queues */ - queues?: (google.cloud.tasks.v2.IQueue[]|null); - - /** ListQueuesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListQueuesResponse. */ - class ListQueuesResponse implements IListQueuesResponse { - - /** - * Constructs a new ListQueuesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IListQueuesResponse); - - /** ListQueuesResponse queues. */ - public queues: google.cloud.tasks.v2.IQueue[]; - - /** ListQueuesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListQueuesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListQueuesResponse instance - */ - public static create(properties?: google.cloud.tasks.v2.IListQueuesResponse): google.cloud.tasks.v2.ListQueuesResponse; - - /** - * Encodes the specified ListQueuesResponse message. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesResponse.verify|verify} messages. - * @param message ListQueuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IListQueuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListQueuesResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesResponse.verify|verify} messages. - * @param message ListQueuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IListQueuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.ListQueuesResponse; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.ListQueuesResponse; - - /** - * Verifies a ListQueuesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListQueuesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListQueuesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.ListQueuesResponse; - - /** - * Creates a plain object from a ListQueuesResponse message. Also converts values to other types if specified. - * @param message ListQueuesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.ListQueuesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListQueuesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListQueuesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetQueueRequest. */ - interface IGetQueueRequest { - - /** GetQueueRequest name */ - name?: (string|null); - } - - /** Represents a GetQueueRequest. */ - class GetQueueRequest implements IGetQueueRequest { - - /** - * Constructs a new GetQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IGetQueueRequest); - - /** GetQueueRequest name. */ - public name: string; - - /** - * Creates a new GetQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IGetQueueRequest): google.cloud.tasks.v2.GetQueueRequest; - - /** - * Encodes the specified GetQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.GetQueueRequest.verify|verify} messages. - * @param message GetQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IGetQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.GetQueueRequest.verify|verify} messages. - * @param message GetQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IGetQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.GetQueueRequest; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.GetQueueRequest; - - /** - * Verifies a GetQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.GetQueueRequest; - - /** - * Creates a plain object from a GetQueueRequest message. Also converts values to other types if specified. - * @param message GetQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.GetQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateQueueRequest. */ - interface ICreateQueueRequest { - - /** CreateQueueRequest parent */ - parent?: (string|null); - - /** CreateQueueRequest queue */ - queue?: (google.cloud.tasks.v2.IQueue|null); - } - - /** Represents a CreateQueueRequest. */ - class CreateQueueRequest implements ICreateQueueRequest { - - /** - * Constructs a new CreateQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.ICreateQueueRequest); - - /** CreateQueueRequest parent. */ - public parent: string; - - /** CreateQueueRequest queue. */ - public queue?: (google.cloud.tasks.v2.IQueue|null); - - /** - * Creates a new CreateQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.ICreateQueueRequest): google.cloud.tasks.v2.CreateQueueRequest; - - /** - * Encodes the specified CreateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.CreateQueueRequest.verify|verify} messages. - * @param message CreateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.ICreateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.CreateQueueRequest.verify|verify} messages. - * @param message CreateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.ICreateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.CreateQueueRequest; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.CreateQueueRequest; - - /** - * Verifies a CreateQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.CreateQueueRequest; - - /** - * Creates a plain object from a CreateQueueRequest message. Also converts values to other types if specified. - * @param message CreateQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.CreateQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateQueueRequest. */ - interface IUpdateQueueRequest { - - /** UpdateQueueRequest queue */ - queue?: (google.cloud.tasks.v2.IQueue|null); - - /** UpdateQueueRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateQueueRequest. */ - class UpdateQueueRequest implements IUpdateQueueRequest { - - /** - * Constructs a new UpdateQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IUpdateQueueRequest); - - /** UpdateQueueRequest queue. */ - public queue?: (google.cloud.tasks.v2.IQueue|null); - - /** UpdateQueueRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IUpdateQueueRequest): google.cloud.tasks.v2.UpdateQueueRequest; - - /** - * Encodes the specified UpdateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.UpdateQueueRequest.verify|verify} messages. - * @param message UpdateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IUpdateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.UpdateQueueRequest.verify|verify} messages. - * @param message UpdateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IUpdateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.UpdateQueueRequest; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.UpdateQueueRequest; - - /** - * Verifies an UpdateQueueRequest message. - * @param message Plain 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 UpdateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.UpdateQueueRequest; - - /** - * Creates a plain object from an UpdateQueueRequest message. Also converts values to other types if specified. - * @param message UpdateQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.UpdateQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteQueueRequest. */ - interface IDeleteQueueRequest { - - /** DeleteQueueRequest name */ - name?: (string|null); - } - - /** Represents a DeleteQueueRequest. */ - class DeleteQueueRequest implements IDeleteQueueRequest { - - /** - * Constructs a new DeleteQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IDeleteQueueRequest); - - /** DeleteQueueRequest name. */ - public name: string; - - /** - * Creates a new DeleteQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IDeleteQueueRequest): google.cloud.tasks.v2.DeleteQueueRequest; - - /** - * Encodes the specified DeleteQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.DeleteQueueRequest.verify|verify} messages. - * @param message DeleteQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IDeleteQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.DeleteQueueRequest.verify|verify} messages. - * @param message DeleteQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IDeleteQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.DeleteQueueRequest; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.DeleteQueueRequest; - - /** - * Verifies a DeleteQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.DeleteQueueRequest; - - /** - * Creates a plain object from a DeleteQueueRequest message. Also converts values to other types if specified. - * @param message DeleteQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.DeleteQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PurgeQueueRequest. */ - interface IPurgeQueueRequest { - - /** PurgeQueueRequest name */ - name?: (string|null); - } - - /** Represents a PurgeQueueRequest. */ - class PurgeQueueRequest implements IPurgeQueueRequest { - - /** - * Constructs a new PurgeQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IPurgeQueueRequest); - - /** PurgeQueueRequest name. */ - public name: string; - - /** - * Creates a new PurgeQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PurgeQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IPurgeQueueRequest): google.cloud.tasks.v2.PurgeQueueRequest; - - /** - * Encodes the specified PurgeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.PurgeQueueRequest.verify|verify} messages. - * @param message PurgeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IPurgeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PurgeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.PurgeQueueRequest.verify|verify} messages. - * @param message PurgeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IPurgeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.PurgeQueueRequest; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.PurgeQueueRequest; - - /** - * Verifies a PurgeQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PurgeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PurgeQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.PurgeQueueRequest; - - /** - * Creates a plain object from a PurgeQueueRequest message. Also converts values to other types if specified. - * @param message PurgeQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.PurgeQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PurgeQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PurgeQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PauseQueueRequest. */ - interface IPauseQueueRequest { - - /** PauseQueueRequest name */ - name?: (string|null); - } - - /** Represents a PauseQueueRequest. */ - class PauseQueueRequest implements IPauseQueueRequest { - - /** - * Constructs a new PauseQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IPauseQueueRequest); - - /** PauseQueueRequest name. */ - public name: string; - - /** - * Creates a new PauseQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PauseQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IPauseQueueRequest): google.cloud.tasks.v2.PauseQueueRequest; - - /** - * Encodes the specified PauseQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.PauseQueueRequest.verify|verify} messages. - * @param message PauseQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IPauseQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PauseQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.PauseQueueRequest.verify|verify} messages. - * @param message PauseQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IPauseQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.PauseQueueRequest; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.PauseQueueRequest; - - /** - * Verifies a PauseQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PauseQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PauseQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.PauseQueueRequest; - - /** - * Creates a plain object from a PauseQueueRequest message. Also converts values to other types if specified. - * @param message PauseQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.PauseQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PauseQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PauseQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResumeQueueRequest. */ - interface IResumeQueueRequest { - - /** ResumeQueueRequest name */ - name?: (string|null); - } - - /** Represents a ResumeQueueRequest. */ - class ResumeQueueRequest implements IResumeQueueRequest { - - /** - * Constructs a new ResumeQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IResumeQueueRequest); - - /** ResumeQueueRequest name. */ - public name: string; - - /** - * Creates a new ResumeQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ResumeQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IResumeQueueRequest): google.cloud.tasks.v2.ResumeQueueRequest; - - /** - * Encodes the specified ResumeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.ResumeQueueRequest.verify|verify} messages. - * @param message ResumeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IResumeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResumeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ResumeQueueRequest.verify|verify} messages. - * @param message ResumeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IResumeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.ResumeQueueRequest; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.ResumeQueueRequest; - - /** - * Verifies a ResumeQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResumeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResumeQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.ResumeQueueRequest; - - /** - * Creates a plain object from a ResumeQueueRequest message. Also converts values to other types if specified. - * @param message ResumeQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.ResumeQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResumeQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResumeQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest responseView */ - responseView?: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest responseView. */ - public responseView: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View); - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IListTasksRequest): google.cloud.tasks.v2.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.tasks.v2.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.tasks.v2.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.tasks.v2.IListTasksResponse): google.cloud.tasks.v2.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - - /** GetTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** GetTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View); - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IGetTaskRequest): google.cloud.tasks.v2.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateTaskRequest. */ - interface ICreateTaskRequest { - - /** CreateTaskRequest parent */ - parent?: (string|null); - - /** CreateTaskRequest task */ - task?: (google.cloud.tasks.v2.ITask|null); - - /** CreateTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View|null); - } - - /** Represents a CreateTaskRequest. */ - class CreateTaskRequest implements ICreateTaskRequest { - - /** - * Constructs a new CreateTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.ICreateTaskRequest); - - /** CreateTaskRequest parent. */ - public parent: string; - - /** CreateTaskRequest task. */ - public task?: (google.cloud.tasks.v2.ITask|null); - - /** CreateTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View); - - /** - * Creates a new CreateTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.ICreateTaskRequest): google.cloud.tasks.v2.CreateTaskRequest; - - /** - * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.CreateTaskRequest.verify|verify} messages. - * @param message CreateTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.CreateTaskRequest.verify|verify} messages. - * @param message CreateTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.CreateTaskRequest; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.CreateTaskRequest; - - /** - * Verifies a CreateTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.CreateTaskRequest; - - /** - * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. - * @param message CreateTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.CreateTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteTaskRequest. */ - interface IDeleteTaskRequest { - - /** DeleteTaskRequest name */ - name?: (string|null); - } - - /** Represents a DeleteTaskRequest. */ - class DeleteTaskRequest implements IDeleteTaskRequest { - - /** - * Constructs a new DeleteTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IDeleteTaskRequest); - - /** DeleteTaskRequest name. */ - public name: string; - - /** - * Creates a new DeleteTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IDeleteTaskRequest): google.cloud.tasks.v2.DeleteTaskRequest; - - /** - * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.DeleteTaskRequest.verify|verify} messages. - * @param message DeleteTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.DeleteTaskRequest.verify|verify} messages. - * @param message DeleteTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.DeleteTaskRequest; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.DeleteTaskRequest; - - /** - * Verifies a DeleteTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.DeleteTaskRequest; - - /** - * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. - * @param message DeleteTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.DeleteTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunTaskRequest. */ - interface IRunTaskRequest { - - /** RunTaskRequest name */ - name?: (string|null); - - /** RunTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View|null); - } - - /** Represents a RunTaskRequest. */ - class RunTaskRequest implements IRunTaskRequest { - - /** - * Constructs a new RunTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IRunTaskRequest); - - /** RunTaskRequest name. */ - public name: string; - - /** RunTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View); - - /** - * Creates a new RunTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IRunTaskRequest): google.cloud.tasks.v2.RunTaskRequest; - - /** - * Encodes the specified RunTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.RunTaskRequest.verify|verify} messages. - * @param message RunTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IRunTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.RunTaskRequest.verify|verify} messages. - * @param message RunTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IRunTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.RunTaskRequest; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.RunTaskRequest; - - /** - * Verifies a RunTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.RunTaskRequest; - - /** - * Creates a plain object from a RunTaskRequest message. Also converts values to other types if specified. - * @param message RunTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.RunTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Queue. */ - interface IQueue { - - /** Queue name */ - name?: (string|null); - - /** Queue appEngineRoutingOverride */ - appEngineRoutingOverride?: (google.cloud.tasks.v2.IAppEngineRouting|null); - - /** Queue rateLimits */ - rateLimits?: (google.cloud.tasks.v2.IRateLimits|null); - - /** Queue retryConfig */ - retryConfig?: (google.cloud.tasks.v2.IRetryConfig|null); - - /** Queue state */ - state?: (google.cloud.tasks.v2.Queue.State|keyof typeof google.cloud.tasks.v2.Queue.State|null); - - /** Queue purgeTime */ - purgeTime?: (google.protobuf.ITimestamp|null); - - /** Queue stackdriverLoggingConfig */ - stackdriverLoggingConfig?: (google.cloud.tasks.v2.IStackdriverLoggingConfig|null); - } - - /** Represents a Queue. */ - class Queue implements IQueue { - - /** - * Constructs a new Queue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IQueue); - - /** Queue name. */ - public name: string; - - /** Queue appEngineRoutingOverride. */ - public appEngineRoutingOverride?: (google.cloud.tasks.v2.IAppEngineRouting|null); - - /** Queue rateLimits. */ - public rateLimits?: (google.cloud.tasks.v2.IRateLimits|null); - - /** Queue retryConfig. */ - public retryConfig?: (google.cloud.tasks.v2.IRetryConfig|null); - - /** Queue state. */ - public state: (google.cloud.tasks.v2.Queue.State|keyof typeof google.cloud.tasks.v2.Queue.State); - - /** Queue purgeTime. */ - public purgeTime?: (google.protobuf.ITimestamp|null); - - /** Queue stackdriverLoggingConfig. */ - public stackdriverLoggingConfig?: (google.cloud.tasks.v2.IStackdriverLoggingConfig|null); - - /** - * Creates a new Queue instance using the specified properties. - * @param [properties] Properties to set - * @returns Queue instance - */ - public static create(properties?: google.cloud.tasks.v2.IQueue): google.cloud.tasks.v2.Queue; - - /** - * Encodes the specified Queue message. Does not implicitly {@link google.cloud.tasks.v2.Queue.verify|verify} messages. - * @param message Queue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Queue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.Queue.verify|verify} messages. - * @param message Queue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Queue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.Queue; - - /** - * Decodes a Queue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.Queue; - - /** - * Verifies a Queue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Queue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Queue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.Queue; - - /** - * Creates a plain object from a Queue message. Also converts values to other types if specified. - * @param message Queue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.Queue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Queue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Queue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Queue { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - PAUSED = 2, - DISABLED = 3 - } - } - - /** Properties of a RateLimits. */ - interface IRateLimits { - - /** RateLimits maxDispatchesPerSecond */ - maxDispatchesPerSecond?: (number|null); - - /** RateLimits maxBurstSize */ - maxBurstSize?: (number|null); - - /** RateLimits maxConcurrentDispatches */ - maxConcurrentDispatches?: (number|null); - } - - /** Represents a RateLimits. */ - class RateLimits implements IRateLimits { - - /** - * Constructs a new RateLimits. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IRateLimits); - - /** RateLimits maxDispatchesPerSecond. */ - public maxDispatchesPerSecond: number; - - /** RateLimits maxBurstSize. */ - public maxBurstSize: number; - - /** RateLimits maxConcurrentDispatches. */ - public maxConcurrentDispatches: number; - - /** - * Creates a new RateLimits instance using the specified properties. - * @param [properties] Properties to set - * @returns RateLimits instance - */ - public static create(properties?: google.cloud.tasks.v2.IRateLimits): google.cloud.tasks.v2.RateLimits; - - /** - * Encodes the specified RateLimits message. Does not implicitly {@link google.cloud.tasks.v2.RateLimits.verify|verify} messages. - * @param message RateLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IRateLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RateLimits message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.RateLimits.verify|verify} messages. - * @param message RateLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IRateLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RateLimits message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.RateLimits; - - /** - * Decodes a RateLimits message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.RateLimits; - - /** - * Verifies a RateLimits message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RateLimits message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RateLimits - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.RateLimits; - - /** - * Creates a plain object from a RateLimits message. Also converts values to other types if specified. - * @param message RateLimits - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.RateLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RateLimits to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RateLimits - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetryConfig. */ - interface IRetryConfig { - - /** RetryConfig maxAttempts */ - maxAttempts?: (number|null); - - /** RetryConfig maxRetryDuration */ - maxRetryDuration?: (google.protobuf.IDuration|null); - - /** RetryConfig minBackoff */ - minBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxBackoff */ - maxBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxDoublings */ - maxDoublings?: (number|null); - } - - /** Represents a RetryConfig. */ - class RetryConfig implements IRetryConfig { - - /** - * Constructs a new RetryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IRetryConfig); - - /** RetryConfig maxAttempts. */ - public maxAttempts: number; - - /** RetryConfig maxRetryDuration. */ - public maxRetryDuration?: (google.protobuf.IDuration|null); - - /** RetryConfig minBackoff. */ - public minBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxBackoff. */ - public maxBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxDoublings. */ - public maxDoublings: number; - - /** - * Creates a new RetryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RetryConfig instance - */ - public static create(properties?: google.cloud.tasks.v2.IRetryConfig): google.cloud.tasks.v2.RetryConfig; - - /** - * Encodes the specified RetryConfig message. Does not implicitly {@link google.cloud.tasks.v2.RetryConfig.verify|verify} messages. - * @param message RetryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IRetryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetryConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.RetryConfig.verify|verify} messages. - * @param message RetryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IRetryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.RetryConfig; - - /** - * Decodes a RetryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.RetryConfig; - - /** - * Verifies a RetryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.RetryConfig; - - /** - * Creates a plain object from a RetryConfig message. Also converts values to other types if specified. - * @param message RetryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.RetryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StackdriverLoggingConfig. */ - interface IStackdriverLoggingConfig { - - /** StackdriverLoggingConfig samplingRatio */ - samplingRatio?: (number|null); - } - - /** Represents a StackdriverLoggingConfig. */ - class StackdriverLoggingConfig implements IStackdriverLoggingConfig { - - /** - * Constructs a new StackdriverLoggingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IStackdriverLoggingConfig); - - /** StackdriverLoggingConfig samplingRatio. */ - public samplingRatio: number; - - /** - * Creates a new StackdriverLoggingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns StackdriverLoggingConfig instance - */ - public static create(properties?: google.cloud.tasks.v2.IStackdriverLoggingConfig): google.cloud.tasks.v2.StackdriverLoggingConfig; - - /** - * Encodes the specified StackdriverLoggingConfig message. Does not implicitly {@link google.cloud.tasks.v2.StackdriverLoggingConfig.verify|verify} messages. - * @param message StackdriverLoggingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IStackdriverLoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StackdriverLoggingConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.StackdriverLoggingConfig.verify|verify} messages. - * @param message StackdriverLoggingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IStackdriverLoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.StackdriverLoggingConfig; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.StackdriverLoggingConfig; - - /** - * Verifies a StackdriverLoggingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StackdriverLoggingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StackdriverLoggingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.StackdriverLoggingConfig; - - /** - * Creates a plain object from a StackdriverLoggingConfig message. Also converts values to other types if specified. - * @param message StackdriverLoggingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.StackdriverLoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StackdriverLoggingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StackdriverLoggingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRequest. */ - interface IHttpRequest { - - /** HttpRequest url */ - url?: (string|null); - - /** HttpRequest httpMethod */ - httpMethod?: (google.cloud.tasks.v2.HttpMethod|keyof typeof google.cloud.tasks.v2.HttpMethod|null); - - /** HttpRequest headers */ - headers?: ({ [k: string]: string }|null); - - /** HttpRequest body */ - body?: (Uint8Array|string|null); - - /** HttpRequest oauthToken */ - oauthToken?: (google.cloud.tasks.v2.IOAuthToken|null); - - /** HttpRequest oidcToken */ - oidcToken?: (google.cloud.tasks.v2.IOidcToken|null); - } - - /** Represents a HttpRequest. */ - class HttpRequest implements IHttpRequest { - - /** - * Constructs a new HttpRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IHttpRequest); - - /** HttpRequest url. */ - public url: string; - - /** HttpRequest httpMethod. */ - public httpMethod: (google.cloud.tasks.v2.HttpMethod|keyof typeof google.cloud.tasks.v2.HttpMethod); - - /** HttpRequest headers. */ - public headers: { [k: string]: string }; - - /** HttpRequest body. */ - public body: (Uint8Array|string); - - /** HttpRequest oauthToken. */ - public oauthToken?: (google.cloud.tasks.v2.IOAuthToken|null); - - /** HttpRequest oidcToken. */ - public oidcToken?: (google.cloud.tasks.v2.IOidcToken|null); - - /** HttpRequest authorizationHeader. */ - public authorizationHeader?: ("oauthToken"|"oidcToken"); - - /** - * Creates a new HttpRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IHttpRequest): google.cloud.tasks.v2.HttpRequest; - - /** - * Encodes the specified HttpRequest message. Does not implicitly {@link google.cloud.tasks.v2.HttpRequest.verify|verify} messages. - * @param message HttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.HttpRequest.verify|verify} messages. - * @param message HttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.HttpRequest; - - /** - * Decodes a HttpRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.HttpRequest; - - /** - * Verifies a HttpRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.HttpRequest; - - /** - * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. - * @param message HttpRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.HttpRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineHttpRequest. */ - interface IAppEngineHttpRequest { - - /** AppEngineHttpRequest httpMethod */ - httpMethod?: (google.cloud.tasks.v2.HttpMethod|keyof typeof google.cloud.tasks.v2.HttpMethod|null); - - /** AppEngineHttpRequest appEngineRouting */ - appEngineRouting?: (google.cloud.tasks.v2.IAppEngineRouting|null); - - /** AppEngineHttpRequest relativeUri */ - relativeUri?: (string|null); - - /** AppEngineHttpRequest headers */ - headers?: ({ [k: string]: string }|null); - - /** AppEngineHttpRequest body */ - body?: (Uint8Array|string|null); - } - - /** Represents an AppEngineHttpRequest. */ - class AppEngineHttpRequest implements IAppEngineHttpRequest { - - /** - * Constructs a new AppEngineHttpRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IAppEngineHttpRequest); - - /** AppEngineHttpRequest httpMethod. */ - public httpMethod: (google.cloud.tasks.v2.HttpMethod|keyof typeof google.cloud.tasks.v2.HttpMethod); - - /** AppEngineHttpRequest appEngineRouting. */ - public appEngineRouting?: (google.cloud.tasks.v2.IAppEngineRouting|null); - - /** AppEngineHttpRequest relativeUri. */ - public relativeUri: string; - - /** AppEngineHttpRequest headers. */ - public headers: { [k: string]: string }; - - /** AppEngineHttpRequest body. */ - public body: (Uint8Array|string); - - /** - * Creates a new AppEngineHttpRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineHttpRequest instance - */ - public static create(properties?: google.cloud.tasks.v2.IAppEngineHttpRequest): google.cloud.tasks.v2.AppEngineHttpRequest; - - /** - * Encodes the specified AppEngineHttpRequest message. Does not implicitly {@link google.cloud.tasks.v2.AppEngineHttpRequest.verify|verify} messages. - * @param message AppEngineHttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IAppEngineHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineHttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.AppEngineHttpRequest.verify|verify} messages. - * @param message AppEngineHttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IAppEngineHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.AppEngineHttpRequest; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.AppEngineHttpRequest; - - /** - * Verifies an AppEngineHttpRequest message. - * @param message Plain 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 AppEngineHttpRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineHttpRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.AppEngineHttpRequest; - - /** - * Creates a plain object from an AppEngineHttpRequest message. Also converts values to other types if specified. - * @param message AppEngineHttpRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.AppEngineHttpRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineHttpRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineHttpRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineRouting. */ - interface IAppEngineRouting { - - /** AppEngineRouting service */ - service?: (string|null); - - /** AppEngineRouting version */ - version?: (string|null); - - /** AppEngineRouting instance */ - instance?: (string|null); - - /** AppEngineRouting host */ - host?: (string|null); - } - - /** Represents an AppEngineRouting. */ - class AppEngineRouting implements IAppEngineRouting { - - /** - * Constructs a new AppEngineRouting. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IAppEngineRouting); - - /** AppEngineRouting service. */ - public service: string; - - /** AppEngineRouting version. */ - public version: string; - - /** AppEngineRouting instance. */ - public instance: string; - - /** AppEngineRouting host. */ - public host: string; - - /** - * Creates a new AppEngineRouting instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineRouting instance - */ - public static create(properties?: google.cloud.tasks.v2.IAppEngineRouting): google.cloud.tasks.v2.AppEngineRouting; - - /** - * Encodes the specified AppEngineRouting message. Does not implicitly {@link google.cloud.tasks.v2.AppEngineRouting.verify|verify} messages. - * @param message AppEngineRouting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IAppEngineRouting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineRouting message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.AppEngineRouting.verify|verify} messages. - * @param message AppEngineRouting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IAppEngineRouting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.AppEngineRouting; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.AppEngineRouting; - - /** - * Verifies an AppEngineRouting message. - * @param message Plain 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 AppEngineRouting message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineRouting - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.AppEngineRouting; - - /** - * Creates a plain object from an AppEngineRouting message. Also converts values to other types if specified. - * @param message AppEngineRouting - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.AppEngineRouting, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineRouting to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineRouting - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** HttpMethod enum. */ - enum HttpMethod { - HTTP_METHOD_UNSPECIFIED = 0, - POST = 1, - GET = 2, - HEAD = 3, - PUT = 4, - DELETE = 5, - PATCH = 6, - OPTIONS = 7 - } - - /** Properties of a OAuthToken. */ - interface IOAuthToken { - - /** OAuthToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** OAuthToken scope */ - scope?: (string|null); - } - - /** Represents a OAuthToken. */ - class OAuthToken implements IOAuthToken { - - /** - * Constructs a new OAuthToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IOAuthToken); - - /** OAuthToken serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** OAuthToken scope. */ - public scope: string; - - /** - * Creates a new OAuthToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OAuthToken instance - */ - public static create(properties?: google.cloud.tasks.v2.IOAuthToken): google.cloud.tasks.v2.OAuthToken; - - /** - * Encodes the specified OAuthToken message. Does not implicitly {@link google.cloud.tasks.v2.OAuthToken.verify|verify} messages. - * @param message OAuthToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IOAuthToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OAuthToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.OAuthToken.verify|verify} messages. - * @param message OAuthToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IOAuthToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a OAuthToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.OAuthToken; - - /** - * Decodes a OAuthToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.OAuthToken; - - /** - * Verifies a OAuthToken message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a OAuthToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OAuthToken - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.OAuthToken; - - /** - * Creates a plain object from a OAuthToken message. Also converts values to other types if specified. - * @param message OAuthToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.OAuthToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OAuthToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OAuthToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OidcToken. */ - interface IOidcToken { - - /** OidcToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** OidcToken audience */ - audience?: (string|null); - } - - /** Represents an OidcToken. */ - class OidcToken implements IOidcToken { - - /** - * Constructs a new OidcToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IOidcToken); - - /** OidcToken serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** OidcToken audience. */ - public audience: string; - - /** - * Creates a new OidcToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OidcToken instance - */ - public static create(properties?: google.cloud.tasks.v2.IOidcToken): google.cloud.tasks.v2.OidcToken; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.cloud.tasks.v2.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.OidcToken; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.OidcToken; - - /** - * Verifies an OidcToken message. - * @param message Plain 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 OidcToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OidcToken - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.OidcToken; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @param message OidcToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OidcToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OidcToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task appEngineHttpRequest */ - appEngineHttpRequest?: (google.cloud.tasks.v2.IAppEngineHttpRequest|null); - - /** Task httpRequest */ - httpRequest?: (google.cloud.tasks.v2.IHttpRequest|null); - - /** Task scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Task createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Task dispatchDeadline */ - dispatchDeadline?: (google.protobuf.IDuration|null); - - /** Task dispatchCount */ - dispatchCount?: (number|null); - - /** Task responseCount */ - responseCount?: (number|null); - - /** Task firstAttempt */ - firstAttempt?: (google.cloud.tasks.v2.IAttempt|null); - - /** Task lastAttempt */ - lastAttempt?: (google.cloud.tasks.v2.IAttempt|null); - - /** Task view */ - view?: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.ITask); - - /** Task name. */ - public name: string; - - /** Task appEngineHttpRequest. */ - public appEngineHttpRequest?: (google.cloud.tasks.v2.IAppEngineHttpRequest|null); - - /** Task httpRequest. */ - public httpRequest?: (google.cloud.tasks.v2.IHttpRequest|null); - - /** Task scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Task createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Task dispatchDeadline. */ - public dispatchDeadline?: (google.protobuf.IDuration|null); - - /** Task dispatchCount. */ - public dispatchCount: number; - - /** Task responseCount. */ - public responseCount: number; - - /** Task firstAttempt. */ - public firstAttempt?: (google.cloud.tasks.v2.IAttempt|null); - - /** Task lastAttempt. */ - public lastAttempt?: (google.cloud.tasks.v2.IAttempt|null); - - /** Task view. */ - public view: (google.cloud.tasks.v2.Task.View|keyof typeof google.cloud.tasks.v2.Task.View); - - /** Task messageType. */ - public messageType?: ("appEngineHttpRequest"|"httpRequest"); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.tasks.v2.ITask): google.cloud.tasks.v2.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.tasks.v2.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Task { - - /** View enum. */ - enum View { - VIEW_UNSPECIFIED = 0, - BASIC = 1, - FULL = 2 - } - } - - /** Properties of an Attempt. */ - interface IAttempt { - - /** Attempt scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Attempt dispatchTime */ - dispatchTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseTime */ - responseTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseStatus */ - responseStatus?: (google.rpc.IStatus|null); - } - - /** Represents an Attempt. */ - class Attempt implements IAttempt { - - /** - * Constructs a new Attempt. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2.IAttempt); - - /** Attempt scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Attempt dispatchTime. */ - public dispatchTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseTime. */ - public responseTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseStatus. */ - public responseStatus?: (google.rpc.IStatus|null); - - /** - * Creates a new Attempt instance using the specified properties. - * @param [properties] Properties to set - * @returns Attempt instance - */ - public static create(properties?: google.cloud.tasks.v2.IAttempt): google.cloud.tasks.v2.Attempt; - - /** - * Encodes the specified Attempt message. Does not implicitly {@link google.cloud.tasks.v2.Attempt.verify|verify} messages. - * @param message Attempt message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2.IAttempt, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attempt message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.Attempt.verify|verify} messages. - * @param message Attempt message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2.IAttempt, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attempt message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2.Attempt; - - /** - * Decodes an Attempt message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2.Attempt; - - /** - * Verifies an Attempt message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Attempt message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attempt - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2.Attempt; - - /** - * Creates a plain object from an Attempt message. Also converts values to other types if specified. - * @param message Attempt - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2.Attempt, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attempt to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attempt - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v2beta2. */ - namespace v2beta2 { - - /** Represents a CloudTasks */ - class CloudTasks extends $protobuf.rpc.Service { - - /** - * Constructs a new CloudTasks 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 CloudTasks 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): CloudTasks; - - /** - * Calls ListQueues. - * @param request ListQueuesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListQueuesResponse - */ - public listQueues(request: google.cloud.tasks.v2beta2.IListQueuesRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.ListQueuesCallback): void; - - /** - * Calls ListQueues. - * @param request ListQueuesRequest message or plain object - * @returns Promise - */ - public listQueues(request: google.cloud.tasks.v2beta2.IListQueuesRequest): Promise; - - /** - * Calls GetQueue. - * @param request GetQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public getQueue(request: google.cloud.tasks.v2beta2.IGetQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.GetQueueCallback): void; - - /** - * Calls GetQueue. - * @param request GetQueueRequest message or plain object - * @returns Promise - */ - public getQueue(request: google.cloud.tasks.v2beta2.IGetQueueRequest): Promise; - - /** - * Calls CreateQueue. - * @param request CreateQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public createQueue(request: google.cloud.tasks.v2beta2.ICreateQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.CreateQueueCallback): void; - - /** - * Calls CreateQueue. - * @param request CreateQueueRequest message or plain object - * @returns Promise - */ - public createQueue(request: google.cloud.tasks.v2beta2.ICreateQueueRequest): Promise; - - /** - * Calls UpdateQueue. - * @param request UpdateQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public updateQueue(request: google.cloud.tasks.v2beta2.IUpdateQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.UpdateQueueCallback): void; - - /** - * Calls UpdateQueue. - * @param request UpdateQueueRequest message or plain object - * @returns Promise - */ - public updateQueue(request: google.cloud.tasks.v2beta2.IUpdateQueueRequest): Promise; - - /** - * Calls DeleteQueue. - * @param request DeleteQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteQueue(request: google.cloud.tasks.v2beta2.IDeleteQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.DeleteQueueCallback): void; - - /** - * Calls DeleteQueue. - * @param request DeleteQueueRequest message or plain object - * @returns Promise - */ - public deleteQueue(request: google.cloud.tasks.v2beta2.IDeleteQueueRequest): Promise; - - /** - * Calls PurgeQueue. - * @param request PurgeQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public purgeQueue(request: google.cloud.tasks.v2beta2.IPurgeQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.PurgeQueueCallback): void; - - /** - * Calls PurgeQueue. - * @param request PurgeQueueRequest message or plain object - * @returns Promise - */ - public purgeQueue(request: google.cloud.tasks.v2beta2.IPurgeQueueRequest): Promise; - - /** - * Calls PauseQueue. - * @param request PauseQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public pauseQueue(request: google.cloud.tasks.v2beta2.IPauseQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.PauseQueueCallback): void; - - /** - * Calls PauseQueue. - * @param request PauseQueueRequest message or plain object - * @returns Promise - */ - public pauseQueue(request: google.cloud.tasks.v2beta2.IPauseQueueRequest): Promise; - - /** - * Calls ResumeQueue. - * @param request ResumeQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public resumeQueue(request: google.cloud.tasks.v2beta2.IResumeQueueRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.ResumeQueueCallback): void; - - /** - * Calls ResumeQueue. - * @param request ResumeQueueRequest message or plain object - * @returns Promise - */ - public resumeQueue(request: google.cloud.tasks.v2beta2.IResumeQueueRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.tasks.v2beta2.IListTasksRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.tasks.v2beta2.IListTasksRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.tasks.v2beta2.IGetTaskRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.tasks.v2beta2.IGetTaskRequest): Promise; - - /** - * Calls CreateTask. - * @param request CreateTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public createTask(request: google.cloud.tasks.v2beta2.ICreateTaskRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.CreateTaskCallback): void; - - /** - * Calls CreateTask. - * @param request CreateTaskRequest message or plain object - * @returns Promise - */ - public createTask(request: google.cloud.tasks.v2beta2.ICreateTaskRequest): Promise; - - /** - * Calls DeleteTask. - * @param request DeleteTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTask(request: google.cloud.tasks.v2beta2.IDeleteTaskRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.DeleteTaskCallback): void; - - /** - * Calls DeleteTask. - * @param request DeleteTaskRequest message or plain object - * @returns Promise - */ - public deleteTask(request: google.cloud.tasks.v2beta2.IDeleteTaskRequest): Promise; - - /** - * Calls LeaseTasks. - * @param request LeaseTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LeaseTasksResponse - */ - public leaseTasks(request: google.cloud.tasks.v2beta2.ILeaseTasksRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.LeaseTasksCallback): void; - - /** - * Calls LeaseTasks. - * @param request LeaseTasksRequest message or plain object - * @returns Promise - */ - public leaseTasks(request: google.cloud.tasks.v2beta2.ILeaseTasksRequest): Promise; - - /** - * Calls AcknowledgeTask. - * @param request AcknowledgeTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public acknowledgeTask(request: google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTaskCallback): void; - - /** - * Calls AcknowledgeTask. - * @param request AcknowledgeTaskRequest message or plain object - * @returns Promise - */ - public acknowledgeTask(request: google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest): Promise; - - /** - * Calls RenewLease. - * @param request RenewLeaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public renewLease(request: google.cloud.tasks.v2beta2.IRenewLeaseRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.RenewLeaseCallback): void; - - /** - * Calls RenewLease. - * @param request RenewLeaseRequest message or plain object - * @returns Promise - */ - public renewLease(request: google.cloud.tasks.v2beta2.IRenewLeaseRequest): Promise; - - /** - * Calls CancelLease. - * @param request CancelLeaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public cancelLease(request: google.cloud.tasks.v2beta2.ICancelLeaseRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.CancelLeaseCallback): void; - - /** - * Calls CancelLease. - * @param request CancelLeaseRequest message or plain object - * @returns Promise - */ - public cancelLease(request: google.cloud.tasks.v2beta2.ICancelLeaseRequest): Promise; - - /** - * Calls RunTask. - * @param request RunTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public runTask(request: google.cloud.tasks.v2beta2.IRunTaskRequest, callback: google.cloud.tasks.v2beta2.CloudTasks.RunTaskCallback): void; - - /** - * Calls RunTask. - * @param request RunTaskRequest message or plain object - * @returns Promise - */ - public runTask(request: google.cloud.tasks.v2beta2.IRunTaskRequest): Promise; - } - - namespace CloudTasks { - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|listQueues}. - * @param error Error, if any - * @param [response] ListQueuesResponse - */ - type ListQueuesCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.ListQueuesResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|getQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type GetQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|createQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type CreateQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|updateQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type UpdateQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|deleteQueue}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteQueueCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|purgeQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type PurgeQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|pauseQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type PauseQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|resumeQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type ResumeQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.ListTasksResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|createTask}. - * @param error Error, if any - * @param [response] Task - */ - type CreateTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|deleteTask}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteTaskCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|leaseTasks}. - * @param error Error, if any - * @param [response] LeaseTasksResponse - */ - type LeaseTasksCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.LeaseTasksResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|acknowledgeTask}. - * @param error Error, if any - * @param [response] Empty - */ - type AcknowledgeTaskCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|renewLease}. - * @param error Error, if any - * @param [response] Task - */ - type RenewLeaseCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|cancelLease}. - * @param error Error, if any - * @param [response] Task - */ - type CancelLeaseCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|runTask}. - * @param error Error, if any - * @param [response] Task - */ - type RunTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta2.Task) => void; - } - - /** Properties of a ListQueuesRequest. */ - interface IListQueuesRequest { - - /** ListQueuesRequest parent */ - parent?: (string|null); - - /** ListQueuesRequest filter */ - filter?: (string|null); - - /** ListQueuesRequest pageSize */ - pageSize?: (number|null); - - /** ListQueuesRequest pageToken */ - pageToken?: (string|null); - - /** ListQueuesRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a ListQueuesRequest. */ - class ListQueuesRequest implements IListQueuesRequest { - - /** - * Constructs a new ListQueuesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IListQueuesRequest); - - /** ListQueuesRequest parent. */ - public parent: string; - - /** ListQueuesRequest filter. */ - public filter: string; - - /** ListQueuesRequest pageSize. */ - public pageSize: number; - - /** ListQueuesRequest pageToken. */ - public pageToken: string; - - /** ListQueuesRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new ListQueuesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListQueuesRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IListQueuesRequest): google.cloud.tasks.v2beta2.ListQueuesRequest; - - /** - * Encodes the specified ListQueuesRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesRequest.verify|verify} messages. - * @param message ListQueuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IListQueuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListQueuesRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesRequest.verify|verify} messages. - * @param message ListQueuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IListQueuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.ListQueuesRequest; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.ListQueuesRequest; - - /** - * Verifies a ListQueuesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListQueuesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListQueuesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.ListQueuesRequest; - - /** - * Creates a plain object from a ListQueuesRequest message. Also converts values to other types if specified. - * @param message ListQueuesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.ListQueuesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListQueuesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListQueuesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListQueuesResponse. */ - interface IListQueuesResponse { - - /** ListQueuesResponse queues */ - queues?: (google.cloud.tasks.v2beta2.IQueue[]|null); - - /** ListQueuesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListQueuesResponse. */ - class ListQueuesResponse implements IListQueuesResponse { - - /** - * Constructs a new ListQueuesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IListQueuesResponse); - - /** ListQueuesResponse queues. */ - public queues: google.cloud.tasks.v2beta2.IQueue[]; - - /** ListQueuesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListQueuesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListQueuesResponse instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IListQueuesResponse): google.cloud.tasks.v2beta2.ListQueuesResponse; - - /** - * Encodes the specified ListQueuesResponse message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesResponse.verify|verify} messages. - * @param message ListQueuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IListQueuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListQueuesResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesResponse.verify|verify} messages. - * @param message ListQueuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IListQueuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.ListQueuesResponse; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.ListQueuesResponse; - - /** - * Verifies a ListQueuesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListQueuesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListQueuesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.ListQueuesResponse; - - /** - * Creates a plain object from a ListQueuesResponse message. Also converts values to other types if specified. - * @param message ListQueuesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.ListQueuesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListQueuesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListQueuesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetQueueRequest. */ - interface IGetQueueRequest { - - /** GetQueueRequest name */ - name?: (string|null); - - /** GetQueueRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a GetQueueRequest. */ - class GetQueueRequest implements IGetQueueRequest { - - /** - * Constructs a new GetQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IGetQueueRequest); - - /** GetQueueRequest name. */ - public name: string; - - /** GetQueueRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new GetQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IGetQueueRequest): google.cloud.tasks.v2beta2.GetQueueRequest; - - /** - * Encodes the specified GetQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.GetQueueRequest.verify|verify} messages. - * @param message GetQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IGetQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.GetQueueRequest.verify|verify} messages. - * @param message GetQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IGetQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.GetQueueRequest; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.GetQueueRequest; - - /** - * Verifies a GetQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.GetQueueRequest; - - /** - * Creates a plain object from a GetQueueRequest message. Also converts values to other types if specified. - * @param message GetQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.GetQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateQueueRequest. */ - interface ICreateQueueRequest { - - /** CreateQueueRequest parent */ - parent?: (string|null); - - /** CreateQueueRequest queue */ - queue?: (google.cloud.tasks.v2beta2.IQueue|null); - } - - /** Represents a CreateQueueRequest. */ - class CreateQueueRequest implements ICreateQueueRequest { - - /** - * Constructs a new CreateQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ICreateQueueRequest); - - /** CreateQueueRequest parent. */ - public parent: string; - - /** CreateQueueRequest queue. */ - public queue?: (google.cloud.tasks.v2beta2.IQueue|null); - - /** - * Creates a new CreateQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ICreateQueueRequest): google.cloud.tasks.v2beta2.CreateQueueRequest; - - /** - * Encodes the specified CreateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateQueueRequest.verify|verify} messages. - * @param message CreateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ICreateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateQueueRequest.verify|verify} messages. - * @param message CreateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ICreateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.CreateQueueRequest; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.CreateQueueRequest; - - /** - * Verifies a CreateQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.CreateQueueRequest; - - /** - * Creates a plain object from a CreateQueueRequest message. Also converts values to other types if specified. - * @param message CreateQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.CreateQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateQueueRequest. */ - interface IUpdateQueueRequest { - - /** UpdateQueueRequest queue */ - queue?: (google.cloud.tasks.v2beta2.IQueue|null); - - /** UpdateQueueRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateQueueRequest. */ - class UpdateQueueRequest implements IUpdateQueueRequest { - - /** - * Constructs a new UpdateQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IUpdateQueueRequest); - - /** UpdateQueueRequest queue. */ - public queue?: (google.cloud.tasks.v2beta2.IQueue|null); - - /** UpdateQueueRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IUpdateQueueRequest): google.cloud.tasks.v2beta2.UpdateQueueRequest; - - /** - * Encodes the specified UpdateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.UpdateQueueRequest.verify|verify} messages. - * @param message UpdateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IUpdateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.UpdateQueueRequest.verify|verify} messages. - * @param message UpdateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IUpdateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.UpdateQueueRequest; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.UpdateQueueRequest; - - /** - * Verifies an UpdateQueueRequest message. - * @param message Plain 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 UpdateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.UpdateQueueRequest; - - /** - * Creates a plain object from an UpdateQueueRequest message. Also converts values to other types if specified. - * @param message UpdateQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.UpdateQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteQueueRequest. */ - interface IDeleteQueueRequest { - - /** DeleteQueueRequest name */ - name?: (string|null); - } - - /** Represents a DeleteQueueRequest. */ - class DeleteQueueRequest implements IDeleteQueueRequest { - - /** - * Constructs a new DeleteQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IDeleteQueueRequest); - - /** DeleteQueueRequest name. */ - public name: string; - - /** - * Creates a new DeleteQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IDeleteQueueRequest): google.cloud.tasks.v2beta2.DeleteQueueRequest; - - /** - * Encodes the specified DeleteQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteQueueRequest.verify|verify} messages. - * @param message DeleteQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IDeleteQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteQueueRequest.verify|verify} messages. - * @param message DeleteQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IDeleteQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.DeleteQueueRequest; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.DeleteQueueRequest; - - /** - * Verifies a DeleteQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.DeleteQueueRequest; - - /** - * Creates a plain object from a DeleteQueueRequest message. Also converts values to other types if specified. - * @param message DeleteQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.DeleteQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PurgeQueueRequest. */ - interface IPurgeQueueRequest { - - /** PurgeQueueRequest name */ - name?: (string|null); - } - - /** Represents a PurgeQueueRequest. */ - class PurgeQueueRequest implements IPurgeQueueRequest { - - /** - * Constructs a new PurgeQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IPurgeQueueRequest); - - /** PurgeQueueRequest name. */ - public name: string; - - /** - * Creates a new PurgeQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PurgeQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IPurgeQueueRequest): google.cloud.tasks.v2beta2.PurgeQueueRequest; - - /** - * Encodes the specified PurgeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.PurgeQueueRequest.verify|verify} messages. - * @param message PurgeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IPurgeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PurgeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PurgeQueueRequest.verify|verify} messages. - * @param message PurgeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IPurgeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.PurgeQueueRequest; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.PurgeQueueRequest; - - /** - * Verifies a PurgeQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PurgeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PurgeQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.PurgeQueueRequest; - - /** - * Creates a plain object from a PurgeQueueRequest message. Also converts values to other types if specified. - * @param message PurgeQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.PurgeQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PurgeQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PurgeQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PauseQueueRequest. */ - interface IPauseQueueRequest { - - /** PauseQueueRequest name */ - name?: (string|null); - } - - /** Represents a PauseQueueRequest. */ - class PauseQueueRequest implements IPauseQueueRequest { - - /** - * Constructs a new PauseQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IPauseQueueRequest); - - /** PauseQueueRequest name. */ - public name: string; - - /** - * Creates a new PauseQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PauseQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IPauseQueueRequest): google.cloud.tasks.v2beta2.PauseQueueRequest; - - /** - * Encodes the specified PauseQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.PauseQueueRequest.verify|verify} messages. - * @param message PauseQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IPauseQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PauseQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PauseQueueRequest.verify|verify} messages. - * @param message PauseQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IPauseQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.PauseQueueRequest; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.PauseQueueRequest; - - /** - * Verifies a PauseQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PauseQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PauseQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.PauseQueueRequest; - - /** - * Creates a plain object from a PauseQueueRequest message. Also converts values to other types if specified. - * @param message PauseQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.PauseQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PauseQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PauseQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResumeQueueRequest. */ - interface IResumeQueueRequest { - - /** ResumeQueueRequest name */ - name?: (string|null); - } - - /** Represents a ResumeQueueRequest. */ - class ResumeQueueRequest implements IResumeQueueRequest { - - /** - * Constructs a new ResumeQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IResumeQueueRequest); - - /** ResumeQueueRequest name. */ - public name: string; - - /** - * Creates a new ResumeQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ResumeQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IResumeQueueRequest): google.cloud.tasks.v2beta2.ResumeQueueRequest; - - /** - * Encodes the specified ResumeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.ResumeQueueRequest.verify|verify} messages. - * @param message ResumeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IResumeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResumeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ResumeQueueRequest.verify|verify} messages. - * @param message ResumeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IResumeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.ResumeQueueRequest; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.ResumeQueueRequest; - - /** - * Verifies a ResumeQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResumeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResumeQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.ResumeQueueRequest; - - /** - * Creates a plain object from a ResumeQueueRequest message. Also converts values to other types if specified. - * @param message ResumeQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.ResumeQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResumeQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResumeQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IListTasksRequest): google.cloud.tasks.v2beta2.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.tasks.v2beta2.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.tasks.v2beta2.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IListTasksResponse): google.cloud.tasks.v2beta2.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - - /** GetTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** GetTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IGetTaskRequest): google.cloud.tasks.v2beta2.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateTaskRequest. */ - interface ICreateTaskRequest { - - /** CreateTaskRequest parent */ - parent?: (string|null); - - /** CreateTaskRequest task */ - task?: (google.cloud.tasks.v2beta2.ITask|null); - - /** CreateTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - } - - /** Represents a CreateTaskRequest. */ - class CreateTaskRequest implements ICreateTaskRequest { - - /** - * Constructs a new CreateTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ICreateTaskRequest); - - /** CreateTaskRequest parent. */ - public parent: string; - - /** CreateTaskRequest task. */ - public task?: (google.cloud.tasks.v2beta2.ITask|null); - - /** CreateTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** - * Creates a new CreateTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ICreateTaskRequest): google.cloud.tasks.v2beta2.CreateTaskRequest; - - /** - * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateTaskRequest.verify|verify} messages. - * @param message CreateTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateTaskRequest.verify|verify} messages. - * @param message CreateTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.CreateTaskRequest; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.CreateTaskRequest; - - /** - * Verifies a CreateTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.CreateTaskRequest; - - /** - * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. - * @param message CreateTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.CreateTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteTaskRequest. */ - interface IDeleteTaskRequest { - - /** DeleteTaskRequest name */ - name?: (string|null); - } - - /** Represents a DeleteTaskRequest. */ - class DeleteTaskRequest implements IDeleteTaskRequest { - - /** - * Constructs a new DeleteTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IDeleteTaskRequest); - - /** DeleteTaskRequest name. */ - public name: string; - - /** - * Creates a new DeleteTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IDeleteTaskRequest): google.cloud.tasks.v2beta2.DeleteTaskRequest; - - /** - * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteTaskRequest.verify|verify} messages. - * @param message DeleteTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteTaskRequest.verify|verify} messages. - * @param message DeleteTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.DeleteTaskRequest; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.DeleteTaskRequest; - - /** - * Verifies a DeleteTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.DeleteTaskRequest; - - /** - * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. - * @param message DeleteTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.DeleteTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LeaseTasksRequest. */ - interface ILeaseTasksRequest { - - /** LeaseTasksRequest parent */ - parent?: (string|null); - - /** LeaseTasksRequest maxTasks */ - maxTasks?: (number|null); - - /** LeaseTasksRequest leaseDuration */ - leaseDuration?: (google.protobuf.IDuration|null); - - /** LeaseTasksRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - - /** LeaseTasksRequest filter */ - filter?: (string|null); - } - - /** Represents a LeaseTasksRequest. */ - class LeaseTasksRequest implements ILeaseTasksRequest { - - /** - * Constructs a new LeaseTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ILeaseTasksRequest); - - /** LeaseTasksRequest parent. */ - public parent: string; - - /** LeaseTasksRequest maxTasks. */ - public maxTasks: number; - - /** LeaseTasksRequest leaseDuration. */ - public leaseDuration?: (google.protobuf.IDuration|null); - - /** LeaseTasksRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** LeaseTasksRequest filter. */ - public filter: string; - - /** - * Creates a new LeaseTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns LeaseTasksRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ILeaseTasksRequest): google.cloud.tasks.v2beta2.LeaseTasksRequest; - - /** - * Encodes the specified LeaseTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.verify|verify} messages. - * @param message LeaseTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ILeaseTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LeaseTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.verify|verify} messages. - * @param message LeaseTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ILeaseTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LeaseTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LeaseTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.LeaseTasksRequest; - - /** - * Decodes a LeaseTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LeaseTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.LeaseTasksRequest; - - /** - * Verifies a LeaseTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LeaseTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LeaseTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.LeaseTasksRequest; - - /** - * Creates a plain object from a LeaseTasksRequest message. Also converts values to other types if specified. - * @param message LeaseTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.LeaseTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LeaseTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LeaseTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LeaseTasksResponse. */ - interface ILeaseTasksResponse { - - /** LeaseTasksResponse tasks */ - tasks?: (google.cloud.tasks.v2beta2.ITask[]|null); - } - - /** Represents a LeaseTasksResponse. */ - class LeaseTasksResponse implements ILeaseTasksResponse { - - /** - * Constructs a new LeaseTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ILeaseTasksResponse); - - /** LeaseTasksResponse tasks. */ - public tasks: google.cloud.tasks.v2beta2.ITask[]; - - /** - * Creates a new LeaseTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns LeaseTasksResponse instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ILeaseTasksResponse): google.cloud.tasks.v2beta2.LeaseTasksResponse; - - /** - * Encodes the specified LeaseTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksResponse.verify|verify} messages. - * @param message LeaseTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ILeaseTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LeaseTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksResponse.verify|verify} messages. - * @param message LeaseTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ILeaseTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LeaseTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LeaseTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.LeaseTasksResponse; - - /** - * Decodes a LeaseTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LeaseTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.LeaseTasksResponse; - - /** - * Verifies a LeaseTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LeaseTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LeaseTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.LeaseTasksResponse; - - /** - * Creates a plain object from a LeaseTasksResponse message. Also converts values to other types if specified. - * @param message LeaseTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.LeaseTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LeaseTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LeaseTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AcknowledgeTaskRequest. */ - interface IAcknowledgeTaskRequest { - - /** AcknowledgeTaskRequest name */ - name?: (string|null); - - /** AcknowledgeTaskRequest scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an AcknowledgeTaskRequest. */ - class AcknowledgeTaskRequest implements IAcknowledgeTaskRequest { - - /** - * Constructs a new AcknowledgeTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest); - - /** AcknowledgeTaskRequest name. */ - public name: string; - - /** AcknowledgeTaskRequest scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new AcknowledgeTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AcknowledgeTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest): google.cloud.tasks.v2beta2.AcknowledgeTaskRequest; - - /** - * Encodes the specified AcknowledgeTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.verify|verify} messages. - * @param message AcknowledgeTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcknowledgeTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.verify|verify} messages. - * @param message AcknowledgeTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcknowledgeTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcknowledgeTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.AcknowledgeTaskRequest; - - /** - * Decodes an AcknowledgeTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcknowledgeTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.AcknowledgeTaskRequest; - - /** - * Verifies an AcknowledgeTaskRequest message. - * @param message Plain 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 AcknowledgeTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcknowledgeTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.AcknowledgeTaskRequest; - - /** - * Creates a plain object from an AcknowledgeTaskRequest message. Also converts values to other types if specified. - * @param message AcknowledgeTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.AcknowledgeTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcknowledgeTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AcknowledgeTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RenewLeaseRequest. */ - interface IRenewLeaseRequest { - - /** RenewLeaseRequest name */ - name?: (string|null); - - /** RenewLeaseRequest scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** RenewLeaseRequest leaseDuration */ - leaseDuration?: (google.protobuf.IDuration|null); - - /** RenewLeaseRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - } - - /** Represents a RenewLeaseRequest. */ - class RenewLeaseRequest implements IRenewLeaseRequest { - - /** - * Constructs a new RenewLeaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IRenewLeaseRequest); - - /** RenewLeaseRequest name. */ - public name: string; - - /** RenewLeaseRequest scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** RenewLeaseRequest leaseDuration. */ - public leaseDuration?: (google.protobuf.IDuration|null); - - /** RenewLeaseRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** - * Creates a new RenewLeaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RenewLeaseRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IRenewLeaseRequest): google.cloud.tasks.v2beta2.RenewLeaseRequest; - - /** - * Encodes the specified RenewLeaseRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.RenewLeaseRequest.verify|verify} messages. - * @param message RenewLeaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IRenewLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RenewLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RenewLeaseRequest.verify|verify} messages. - * @param message RenewLeaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IRenewLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RenewLeaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RenewLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.RenewLeaseRequest; - - /** - * Decodes a RenewLeaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RenewLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.RenewLeaseRequest; - - /** - * Verifies a RenewLeaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RenewLeaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RenewLeaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.RenewLeaseRequest; - - /** - * Creates a plain object from a RenewLeaseRequest message. Also converts values to other types if specified. - * @param message RenewLeaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.RenewLeaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RenewLeaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RenewLeaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelLeaseRequest. */ - interface ICancelLeaseRequest { - - /** CancelLeaseRequest name */ - name?: (string|null); - - /** CancelLeaseRequest scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** CancelLeaseRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - } - - /** Represents a CancelLeaseRequest. */ - class CancelLeaseRequest implements ICancelLeaseRequest { - - /** - * Constructs a new CancelLeaseRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ICancelLeaseRequest); - - /** CancelLeaseRequest name. */ - public name: string; - - /** CancelLeaseRequest scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** CancelLeaseRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** - * Creates a new CancelLeaseRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelLeaseRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ICancelLeaseRequest): google.cloud.tasks.v2beta2.CancelLeaseRequest; - - /** - * Encodes the specified CancelLeaseRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.CancelLeaseRequest.verify|verify} messages. - * @param message CancelLeaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ICancelLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.CancelLeaseRequest.verify|verify} messages. - * @param message CancelLeaseRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ICancelLeaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelLeaseRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.CancelLeaseRequest; - - /** - * Decodes a CancelLeaseRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.CancelLeaseRequest; - - /** - * Verifies a CancelLeaseRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelLeaseRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelLeaseRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.CancelLeaseRequest; - - /** - * Creates a plain object from a CancelLeaseRequest message. Also converts values to other types if specified. - * @param message CancelLeaseRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.CancelLeaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelLeaseRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelLeaseRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunTaskRequest. */ - interface IRunTaskRequest { - - /** RunTaskRequest name */ - name?: (string|null); - - /** RunTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - } - - /** Represents a RunTaskRequest. */ - class RunTaskRequest implements IRunTaskRequest { - - /** - * Constructs a new RunTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IRunTaskRequest); - - /** RunTaskRequest name. */ - public name: string; - - /** RunTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** - * Creates a new RunTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IRunTaskRequest): google.cloud.tasks.v2beta2.RunTaskRequest; - - /** - * Encodes the specified RunTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.RunTaskRequest.verify|verify} messages. - * @param message RunTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IRunTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RunTaskRequest.verify|verify} messages. - * @param message RunTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IRunTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.RunTaskRequest; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.RunTaskRequest; - - /** - * Verifies a RunTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.RunTaskRequest; - - /** - * Creates a plain object from a RunTaskRequest message. Also converts values to other types if specified. - * @param message RunTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.RunTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Queue. */ - interface IQueue { - - /** Queue name */ - name?: (string|null); - - /** Queue appEngineHttpTarget */ - appEngineHttpTarget?: (google.cloud.tasks.v2beta2.IAppEngineHttpTarget|null); - - /** Queue pullTarget */ - pullTarget?: (google.cloud.tasks.v2beta2.IPullTarget|null); - - /** Queue rateLimits */ - rateLimits?: (google.cloud.tasks.v2beta2.IRateLimits|null); - - /** Queue retryConfig */ - retryConfig?: (google.cloud.tasks.v2beta2.IRetryConfig|null); - - /** Queue state */ - state?: (google.cloud.tasks.v2beta2.Queue.State|keyof typeof google.cloud.tasks.v2beta2.Queue.State|null); - - /** Queue purgeTime */ - purgeTime?: (google.protobuf.ITimestamp|null); - - /** Queue taskTtl */ - taskTtl?: (google.protobuf.IDuration|null); - - /** Queue tombstoneTtl */ - tombstoneTtl?: (google.protobuf.IDuration|null); - - /** Queue stats */ - stats?: (google.cloud.tasks.v2beta2.IQueueStats|null); - } - - /** Represents a Queue. */ - class Queue implements IQueue { - - /** - * Constructs a new Queue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IQueue); - - /** Queue name. */ - public name: string; - - /** Queue appEngineHttpTarget. */ - public appEngineHttpTarget?: (google.cloud.tasks.v2beta2.IAppEngineHttpTarget|null); - - /** Queue pullTarget. */ - public pullTarget?: (google.cloud.tasks.v2beta2.IPullTarget|null); - - /** Queue rateLimits. */ - public rateLimits?: (google.cloud.tasks.v2beta2.IRateLimits|null); - - /** Queue retryConfig. */ - public retryConfig?: (google.cloud.tasks.v2beta2.IRetryConfig|null); - - /** Queue state. */ - public state: (google.cloud.tasks.v2beta2.Queue.State|keyof typeof google.cloud.tasks.v2beta2.Queue.State); - - /** Queue purgeTime. */ - public purgeTime?: (google.protobuf.ITimestamp|null); - - /** Queue taskTtl. */ - public taskTtl?: (google.protobuf.IDuration|null); - - /** Queue tombstoneTtl. */ - public tombstoneTtl?: (google.protobuf.IDuration|null); - - /** Queue stats. */ - public stats?: (google.cloud.tasks.v2beta2.IQueueStats|null); - - /** Queue targetType. */ - public targetType?: ("appEngineHttpTarget"|"pullTarget"); - - /** - * Creates a new Queue instance using the specified properties. - * @param [properties] Properties to set - * @returns Queue instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IQueue): google.cloud.tasks.v2beta2.Queue; - - /** - * Encodes the specified Queue message. Does not implicitly {@link google.cloud.tasks.v2beta2.Queue.verify|verify} messages. - * @param message Queue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Queue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.Queue.verify|verify} messages. - * @param message Queue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Queue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.Queue; - - /** - * Decodes a Queue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.Queue; - - /** - * Verifies a Queue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Queue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Queue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.Queue; - - /** - * Creates a plain object from a Queue message. Also converts values to other types if specified. - * @param message Queue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.Queue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Queue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Queue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Queue { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - PAUSED = 2, - DISABLED = 3 - } - } - - /** Properties of a RateLimits. */ - interface IRateLimits { - - /** RateLimits maxTasksDispatchedPerSecond */ - maxTasksDispatchedPerSecond?: (number|null); - - /** RateLimits maxBurstSize */ - maxBurstSize?: (number|null); - - /** RateLimits maxConcurrentTasks */ - maxConcurrentTasks?: (number|null); - } - - /** Represents a RateLimits. */ - class RateLimits implements IRateLimits { - - /** - * Constructs a new RateLimits. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IRateLimits); - - /** RateLimits maxTasksDispatchedPerSecond. */ - public maxTasksDispatchedPerSecond: number; - - /** RateLimits maxBurstSize. */ - public maxBurstSize: number; - - /** RateLimits maxConcurrentTasks. */ - public maxConcurrentTasks: number; - - /** - * Creates a new RateLimits instance using the specified properties. - * @param [properties] Properties to set - * @returns RateLimits instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IRateLimits): google.cloud.tasks.v2beta2.RateLimits; - - /** - * Encodes the specified RateLimits message. Does not implicitly {@link google.cloud.tasks.v2beta2.RateLimits.verify|verify} messages. - * @param message RateLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IRateLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RateLimits message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RateLimits.verify|verify} messages. - * @param message RateLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IRateLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RateLimits message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.RateLimits; - - /** - * Decodes a RateLimits message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.RateLimits; - - /** - * Verifies a RateLimits message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RateLimits message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RateLimits - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.RateLimits; - - /** - * Creates a plain object from a RateLimits message. Also converts values to other types if specified. - * @param message RateLimits - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.RateLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RateLimits to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RateLimits - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetryConfig. */ - interface IRetryConfig { - - /** RetryConfig maxAttempts */ - maxAttempts?: (number|null); - - /** RetryConfig unlimitedAttempts */ - unlimitedAttempts?: (boolean|null); - - /** RetryConfig maxRetryDuration */ - maxRetryDuration?: (google.protobuf.IDuration|null); - - /** RetryConfig minBackoff */ - minBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxBackoff */ - maxBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxDoublings */ - maxDoublings?: (number|null); - } - - /** Represents a RetryConfig. */ - class RetryConfig implements IRetryConfig { - - /** - * Constructs a new RetryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IRetryConfig); - - /** RetryConfig maxAttempts. */ - public maxAttempts?: (number|null); - - /** RetryConfig unlimitedAttempts. */ - public unlimitedAttempts?: (boolean|null); - - /** RetryConfig maxRetryDuration. */ - public maxRetryDuration?: (google.protobuf.IDuration|null); - - /** RetryConfig minBackoff. */ - public minBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxBackoff. */ - public maxBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxDoublings. */ - public maxDoublings: number; - - /** RetryConfig numAttempts. */ - public numAttempts?: ("maxAttempts"|"unlimitedAttempts"); - - /** - * Creates a new RetryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RetryConfig instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IRetryConfig): google.cloud.tasks.v2beta2.RetryConfig; - - /** - * Encodes the specified RetryConfig message. Does not implicitly {@link google.cloud.tasks.v2beta2.RetryConfig.verify|verify} messages. - * @param message RetryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IRetryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetryConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RetryConfig.verify|verify} messages. - * @param message RetryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IRetryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.RetryConfig; - - /** - * Decodes a RetryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.RetryConfig; - - /** - * Verifies a RetryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.RetryConfig; - - /** - * Creates a plain object from a RetryConfig message. Also converts values to other types if specified. - * @param message RetryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.RetryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueueStats. */ - interface IQueueStats { - - /** QueueStats tasksCount */ - tasksCount?: (number|Long|string|null); - - /** QueueStats oldestEstimatedArrivalTime */ - oldestEstimatedArrivalTime?: (google.protobuf.ITimestamp|null); - - /** QueueStats executedLastMinuteCount */ - executedLastMinuteCount?: (number|Long|string|null); - - /** QueueStats concurrentDispatchesCount */ - concurrentDispatchesCount?: (number|Long|string|null); - - /** QueueStats effectiveExecutionRate */ - effectiveExecutionRate?: (number|null); - } - - /** Represents a QueueStats. */ - class QueueStats implements IQueueStats { - - /** - * Constructs a new QueueStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IQueueStats); - - /** QueueStats tasksCount. */ - public tasksCount: (number|Long|string); - - /** QueueStats oldestEstimatedArrivalTime. */ - public oldestEstimatedArrivalTime?: (google.protobuf.ITimestamp|null); - - /** QueueStats executedLastMinuteCount. */ - public executedLastMinuteCount: (number|Long|string); - - /** QueueStats concurrentDispatchesCount. */ - public concurrentDispatchesCount: (number|Long|string); - - /** QueueStats effectiveExecutionRate. */ - public effectiveExecutionRate: number; - - /** - * Creates a new QueueStats instance using the specified properties. - * @param [properties] Properties to set - * @returns QueueStats instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IQueueStats): google.cloud.tasks.v2beta2.QueueStats; - - /** - * Encodes the specified QueueStats message. Does not implicitly {@link google.cloud.tasks.v2beta2.QueueStats.verify|verify} messages. - * @param message QueueStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IQueueStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueueStats message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.QueueStats.verify|verify} messages. - * @param message QueueStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IQueueStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueueStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.QueueStats; - - /** - * Decodes a QueueStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.QueueStats; - - /** - * Verifies a QueueStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueueStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueueStats - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.QueueStats; - - /** - * Creates a plain object from a QueueStats message. Also converts values to other types if specified. - * @param message QueueStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.QueueStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueueStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueueStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PullTarget. */ - interface IPullTarget { - } - - /** Represents a PullTarget. */ - class PullTarget implements IPullTarget { - - /** - * Constructs a new PullTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IPullTarget); - - /** - * Creates a new PullTarget instance using the specified properties. - * @param [properties] Properties to set - * @returns PullTarget instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IPullTarget): google.cloud.tasks.v2beta2.PullTarget; - - /** - * Encodes the specified PullTarget message. Does not implicitly {@link google.cloud.tasks.v2beta2.PullTarget.verify|verify} messages. - * @param message PullTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IPullTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullTarget message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PullTarget.verify|verify} messages. - * @param message PullTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IPullTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullTarget message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.PullTarget; - - /** - * Decodes a PullTarget message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.PullTarget; - - /** - * Verifies a PullTarget message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PullTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullTarget - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.PullTarget; - - /** - * Creates a plain object from a PullTarget message. Also converts values to other types if specified. - * @param message PullTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.PullTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PullTarget - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PullMessage. */ - interface IPullMessage { - - /** PullMessage payload */ - payload?: (Uint8Array|string|null); - - /** PullMessage tag */ - tag?: (string|null); - } - - /** Represents a PullMessage. */ - class PullMessage implements IPullMessage { - - /** - * Constructs a new PullMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IPullMessage); - - /** PullMessage payload. */ - public payload: (Uint8Array|string); - - /** PullMessage tag. */ - public tag: string; - - /** - * Creates a new PullMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns PullMessage instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IPullMessage): google.cloud.tasks.v2beta2.PullMessage; - - /** - * Encodes the specified PullMessage message. Does not implicitly {@link google.cloud.tasks.v2beta2.PullMessage.verify|verify} messages. - * @param message PullMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IPullMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullMessage message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PullMessage.verify|verify} messages. - * @param message PullMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IPullMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.PullMessage; - - /** - * Decodes a PullMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.PullMessage; - - /** - * Verifies a PullMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PullMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.PullMessage; - - /** - * Creates a plain object from a PullMessage message. Also converts values to other types if specified. - * @param message PullMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.PullMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PullMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineHttpTarget. */ - interface IAppEngineHttpTarget { - - /** AppEngineHttpTarget appEngineRoutingOverride */ - appEngineRoutingOverride?: (google.cloud.tasks.v2beta2.IAppEngineRouting|null); - } - - /** Represents an AppEngineHttpTarget. */ - class AppEngineHttpTarget implements IAppEngineHttpTarget { - - /** - * Constructs a new AppEngineHttpTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IAppEngineHttpTarget); - - /** AppEngineHttpTarget appEngineRoutingOverride. */ - public appEngineRoutingOverride?: (google.cloud.tasks.v2beta2.IAppEngineRouting|null); - - /** - * Creates a new AppEngineHttpTarget instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineHttpTarget instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IAppEngineHttpTarget): google.cloud.tasks.v2beta2.AppEngineHttpTarget; - - /** - * Encodes the specified AppEngineHttpTarget message. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpTarget.verify|verify} messages. - * @param message AppEngineHttpTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IAppEngineHttpTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineHttpTarget message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpTarget.verify|verify} messages. - * @param message AppEngineHttpTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IAppEngineHttpTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineHttpTarget message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineHttpTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.AppEngineHttpTarget; - - /** - * Decodes an AppEngineHttpTarget message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineHttpTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.AppEngineHttpTarget; - - /** - * Verifies an AppEngineHttpTarget message. - * @param message Plain 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 AppEngineHttpTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineHttpTarget - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.AppEngineHttpTarget; - - /** - * Creates a plain object from an AppEngineHttpTarget message. Also converts values to other types if specified. - * @param message AppEngineHttpTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.AppEngineHttpTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineHttpTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineHttpTarget - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineHttpRequest. */ - interface IAppEngineHttpRequest { - - /** AppEngineHttpRequest httpMethod */ - httpMethod?: (google.cloud.tasks.v2beta2.HttpMethod|keyof typeof google.cloud.tasks.v2beta2.HttpMethod|null); - - /** AppEngineHttpRequest appEngineRouting */ - appEngineRouting?: (google.cloud.tasks.v2beta2.IAppEngineRouting|null); - - /** AppEngineHttpRequest relativeUrl */ - relativeUrl?: (string|null); - - /** AppEngineHttpRequest headers */ - headers?: ({ [k: string]: string }|null); - - /** AppEngineHttpRequest payload */ - payload?: (Uint8Array|string|null); - } - - /** Represents an AppEngineHttpRequest. */ - class AppEngineHttpRequest implements IAppEngineHttpRequest { - - /** - * Constructs a new AppEngineHttpRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IAppEngineHttpRequest); - - /** AppEngineHttpRequest httpMethod. */ - public httpMethod: (google.cloud.tasks.v2beta2.HttpMethod|keyof typeof google.cloud.tasks.v2beta2.HttpMethod); - - /** AppEngineHttpRequest appEngineRouting. */ - public appEngineRouting?: (google.cloud.tasks.v2beta2.IAppEngineRouting|null); - - /** AppEngineHttpRequest relativeUrl. */ - public relativeUrl: string; - - /** AppEngineHttpRequest headers. */ - public headers: { [k: string]: string }; - - /** AppEngineHttpRequest payload. */ - public payload: (Uint8Array|string); - - /** - * Creates a new AppEngineHttpRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineHttpRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IAppEngineHttpRequest): google.cloud.tasks.v2beta2.AppEngineHttpRequest; - - /** - * Encodes the specified AppEngineHttpRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpRequest.verify|verify} messages. - * @param message AppEngineHttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IAppEngineHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineHttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpRequest.verify|verify} messages. - * @param message AppEngineHttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IAppEngineHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.AppEngineHttpRequest; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.AppEngineHttpRequest; - - /** - * Verifies an AppEngineHttpRequest message. - * @param message Plain 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 AppEngineHttpRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineHttpRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.AppEngineHttpRequest; - - /** - * Creates a plain object from an AppEngineHttpRequest message. Also converts values to other types if specified. - * @param message AppEngineHttpRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.AppEngineHttpRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineHttpRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineHttpRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineRouting. */ - interface IAppEngineRouting { - - /** AppEngineRouting service */ - service?: (string|null); - - /** AppEngineRouting version */ - version?: (string|null); - - /** AppEngineRouting instance */ - instance?: (string|null); - - /** AppEngineRouting host */ - host?: (string|null); - } - - /** Represents an AppEngineRouting. */ - class AppEngineRouting implements IAppEngineRouting { - - /** - * Constructs a new AppEngineRouting. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IAppEngineRouting); - - /** AppEngineRouting service. */ - public service: string; - - /** AppEngineRouting version. */ - public version: string; - - /** AppEngineRouting instance. */ - public instance: string; - - /** AppEngineRouting host. */ - public host: string; - - /** - * Creates a new AppEngineRouting instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineRouting instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IAppEngineRouting): google.cloud.tasks.v2beta2.AppEngineRouting; - - /** - * Encodes the specified AppEngineRouting message. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineRouting.verify|verify} messages. - * @param message AppEngineRouting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IAppEngineRouting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineRouting message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineRouting.verify|verify} messages. - * @param message AppEngineRouting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IAppEngineRouting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.AppEngineRouting; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.AppEngineRouting; - - /** - * Verifies an AppEngineRouting message. - * @param message Plain 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 AppEngineRouting message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineRouting - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.AppEngineRouting; - - /** - * Creates a plain object from an AppEngineRouting message. Also converts values to other types if specified. - * @param message AppEngineRouting - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.AppEngineRouting, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineRouting to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineRouting - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** HttpMethod enum. */ - enum HttpMethod { - HTTP_METHOD_UNSPECIFIED = 0, - POST = 1, - GET = 2, - HEAD = 3, - PUT = 4, - DELETE = 5 - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task appEngineHttpRequest */ - appEngineHttpRequest?: (google.cloud.tasks.v2beta2.IAppEngineHttpRequest|null); - - /** Task pullMessage */ - pullMessage?: (google.cloud.tasks.v2beta2.IPullMessage|null); - - /** Task scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Task createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Task status */ - status?: (google.cloud.tasks.v2beta2.ITaskStatus|null); - - /** Task view */ - view?: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ITask); - - /** Task name. */ - public name: string; - - /** Task appEngineHttpRequest. */ - public appEngineHttpRequest?: (google.cloud.tasks.v2beta2.IAppEngineHttpRequest|null); - - /** Task pullMessage. */ - public pullMessage?: (google.cloud.tasks.v2beta2.IPullMessage|null); - - /** Task scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Task createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Task status. */ - public status?: (google.cloud.tasks.v2beta2.ITaskStatus|null); - - /** Task view. */ - public view: (google.cloud.tasks.v2beta2.Task.View|keyof typeof google.cloud.tasks.v2beta2.Task.View); - - /** Task payloadType. */ - public payloadType?: ("appEngineHttpRequest"|"pullMessage"); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ITask): google.cloud.tasks.v2beta2.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.tasks.v2beta2.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Task { - - /** View enum. */ - enum View { - VIEW_UNSPECIFIED = 0, - BASIC = 1, - FULL = 2 - } - } - - /** Properties of a TaskStatus. */ - interface ITaskStatus { - - /** TaskStatus attemptDispatchCount */ - attemptDispatchCount?: (number|null); - - /** TaskStatus attemptResponseCount */ - attemptResponseCount?: (number|null); - - /** TaskStatus firstAttemptStatus */ - firstAttemptStatus?: (google.cloud.tasks.v2beta2.IAttemptStatus|null); - - /** TaskStatus lastAttemptStatus */ - lastAttemptStatus?: (google.cloud.tasks.v2beta2.IAttemptStatus|null); - } - - /** Represents a TaskStatus. */ - class TaskStatus implements ITaskStatus { - - /** - * Constructs a new TaskStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.ITaskStatus); - - /** TaskStatus attemptDispatchCount. */ - public attemptDispatchCount: number; - - /** TaskStatus attemptResponseCount. */ - public attemptResponseCount: number; - - /** TaskStatus firstAttemptStatus. */ - public firstAttemptStatus?: (google.cloud.tasks.v2beta2.IAttemptStatus|null); - - /** TaskStatus lastAttemptStatus. */ - public lastAttemptStatus?: (google.cloud.tasks.v2beta2.IAttemptStatus|null); - - /** - * Creates a new TaskStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns TaskStatus instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.ITaskStatus): google.cloud.tasks.v2beta2.TaskStatus; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.tasks.v2beta2.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.TaskStatus.verify|verify} messages. - * @param message TaskStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.ITaskStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.TaskStatus; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.TaskStatus; - - /** - * Verifies a TaskStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TaskStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.TaskStatus; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @param message TaskStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.TaskStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TaskStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TaskStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttemptStatus. */ - interface IAttemptStatus { - - /** AttemptStatus scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** AttemptStatus dispatchTime */ - dispatchTime?: (google.protobuf.ITimestamp|null); - - /** AttemptStatus responseTime */ - responseTime?: (google.protobuf.ITimestamp|null); - - /** AttemptStatus responseStatus */ - responseStatus?: (google.rpc.IStatus|null); - } - - /** Represents an AttemptStatus. */ - class AttemptStatus implements IAttemptStatus { - - /** - * Constructs a new AttemptStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta2.IAttemptStatus); - - /** AttemptStatus scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** AttemptStatus dispatchTime. */ - public dispatchTime?: (google.protobuf.ITimestamp|null); - - /** AttemptStatus responseTime. */ - public responseTime?: (google.protobuf.ITimestamp|null); - - /** AttemptStatus responseStatus. */ - public responseStatus?: (google.rpc.IStatus|null); - - /** - * Creates a new AttemptStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns AttemptStatus instance - */ - public static create(properties?: google.cloud.tasks.v2beta2.IAttemptStatus): google.cloud.tasks.v2beta2.AttemptStatus; - - /** - * Encodes the specified AttemptStatus message. Does not implicitly {@link google.cloud.tasks.v2beta2.AttemptStatus.verify|verify} messages. - * @param message AttemptStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta2.IAttemptStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttemptStatus message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AttemptStatus.verify|verify} messages. - * @param message AttemptStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta2.IAttemptStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttemptStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttemptStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta2.AttemptStatus; - - /** - * Decodes an AttemptStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttemptStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta2.AttemptStatus; - - /** - * Verifies an AttemptStatus message. - * @param message Plain 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 AttemptStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttemptStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta2.AttemptStatus; - - /** - * Creates a plain object from an AttemptStatus message. Also converts values to other types if specified. - * @param message AttemptStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta2.AttemptStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttemptStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttemptStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace v2beta3. */ - namespace v2beta3 { - - /** Represents a CloudTasks */ - class CloudTasks extends $protobuf.rpc.Service { - - /** - * Constructs a new CloudTasks 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 CloudTasks 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): CloudTasks; - - /** - * Calls ListQueues. - * @param request ListQueuesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListQueuesResponse - */ - public listQueues(request: google.cloud.tasks.v2beta3.IListQueuesRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.ListQueuesCallback): void; - - /** - * Calls ListQueues. - * @param request ListQueuesRequest message or plain object - * @returns Promise - */ - public listQueues(request: google.cloud.tasks.v2beta3.IListQueuesRequest): Promise; - - /** - * Calls GetQueue. - * @param request GetQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public getQueue(request: google.cloud.tasks.v2beta3.IGetQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.GetQueueCallback): void; - - /** - * Calls GetQueue. - * @param request GetQueueRequest message or plain object - * @returns Promise - */ - public getQueue(request: google.cloud.tasks.v2beta3.IGetQueueRequest): Promise; - - /** - * Calls CreateQueue. - * @param request CreateQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public createQueue(request: google.cloud.tasks.v2beta3.ICreateQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.CreateQueueCallback): void; - - /** - * Calls CreateQueue. - * @param request CreateQueueRequest message or plain object - * @returns Promise - */ - public createQueue(request: google.cloud.tasks.v2beta3.ICreateQueueRequest): Promise; - - /** - * Calls UpdateQueue. - * @param request UpdateQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public updateQueue(request: google.cloud.tasks.v2beta3.IUpdateQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.UpdateQueueCallback): void; - - /** - * Calls UpdateQueue. - * @param request UpdateQueueRequest message or plain object - * @returns Promise - */ - public updateQueue(request: google.cloud.tasks.v2beta3.IUpdateQueueRequest): Promise; - - /** - * Calls DeleteQueue. - * @param request DeleteQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteQueue(request: google.cloud.tasks.v2beta3.IDeleteQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.DeleteQueueCallback): void; - - /** - * Calls DeleteQueue. - * @param request DeleteQueueRequest message or plain object - * @returns Promise - */ - public deleteQueue(request: google.cloud.tasks.v2beta3.IDeleteQueueRequest): Promise; - - /** - * Calls PurgeQueue. - * @param request PurgeQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public purgeQueue(request: google.cloud.tasks.v2beta3.IPurgeQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.PurgeQueueCallback): void; - - /** - * Calls PurgeQueue. - * @param request PurgeQueueRequest message or plain object - * @returns Promise - */ - public purgeQueue(request: google.cloud.tasks.v2beta3.IPurgeQueueRequest): Promise; - - /** - * Calls PauseQueue. - * @param request PauseQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public pauseQueue(request: google.cloud.tasks.v2beta3.IPauseQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.PauseQueueCallback): void; - - /** - * Calls PauseQueue. - * @param request PauseQueueRequest message or plain object - * @returns Promise - */ - public pauseQueue(request: google.cloud.tasks.v2beta3.IPauseQueueRequest): Promise; - - /** - * Calls ResumeQueue. - * @param request ResumeQueueRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Queue - */ - public resumeQueue(request: google.cloud.tasks.v2beta3.IResumeQueueRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.ResumeQueueCallback): void; - - /** - * Calls ResumeQueue. - * @param request ResumeQueueRequest message or plain object - * @returns Promise - */ - public resumeQueue(request: google.cloud.tasks.v2beta3.IResumeQueueRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTasksResponse - */ - public listTasks(request: google.cloud.tasks.v2beta3.IListTasksRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.ListTasksCallback): void; - - /** - * Calls ListTasks. - * @param request ListTasksRequest message or plain object - * @returns Promise - */ - public listTasks(request: google.cloud.tasks.v2beta3.IListTasksRequest): Promise; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public getTask(request: google.cloud.tasks.v2beta3.IGetTaskRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.GetTaskCallback): void; - - /** - * Calls GetTask. - * @param request GetTaskRequest message or plain object - * @returns Promise - */ - public getTask(request: google.cloud.tasks.v2beta3.IGetTaskRequest): Promise; - - /** - * Calls CreateTask. - * @param request CreateTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public createTask(request: google.cloud.tasks.v2beta3.ICreateTaskRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.CreateTaskCallback): void; - - /** - * Calls CreateTask. - * @param request CreateTaskRequest message or plain object - * @returns Promise - */ - public createTask(request: google.cloud.tasks.v2beta3.ICreateTaskRequest): Promise; - - /** - * Calls DeleteTask. - * @param request DeleteTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteTask(request: google.cloud.tasks.v2beta3.IDeleteTaskRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.DeleteTaskCallback): void; - - /** - * Calls DeleteTask. - * @param request DeleteTaskRequest message or plain object - * @returns Promise - */ - public deleteTask(request: google.cloud.tasks.v2beta3.IDeleteTaskRequest): Promise; - - /** - * Calls RunTask. - * @param request RunTaskRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Task - */ - public runTask(request: google.cloud.tasks.v2beta3.IRunTaskRequest, callback: google.cloud.tasks.v2beta3.CloudTasks.RunTaskCallback): void; - - /** - * Calls RunTask. - * @param request RunTaskRequest message or plain object - * @returns Promise - */ - public runTask(request: google.cloud.tasks.v2beta3.IRunTaskRequest): Promise; - } - - namespace CloudTasks { - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|listQueues}. - * @param error Error, if any - * @param [response] ListQueuesResponse - */ - type ListQueuesCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.ListQueuesResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|getQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type GetQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|createQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type CreateQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|updateQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type UpdateQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|deleteQueue}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteQueueCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|purgeQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type PurgeQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|pauseQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type PauseQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|resumeQueue}. - * @param error Error, if any - * @param [response] Queue - */ - type ResumeQueueCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Queue) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|listTasks}. - * @param error Error, if any - * @param [response] ListTasksResponse - */ - type ListTasksCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.ListTasksResponse) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|getTask}. - * @param error Error, if any - * @param [response] Task - */ - type GetTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|createTask}. - * @param error Error, if any - * @param [response] Task - */ - type CreateTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Task) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|deleteTask}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteTaskCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|runTask}. - * @param error Error, if any - * @param [response] Task - */ - type RunTaskCallback = (error: (Error|null), response?: google.cloud.tasks.v2beta3.Task) => void; - } - - /** Properties of a ListQueuesRequest. */ - interface IListQueuesRequest { - - /** ListQueuesRequest parent */ - parent?: (string|null); - - /** ListQueuesRequest filter */ - filter?: (string|null); - - /** ListQueuesRequest pageSize */ - pageSize?: (number|null); - - /** ListQueuesRequest pageToken */ - pageToken?: (string|null); - - /** ListQueuesRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a ListQueuesRequest. */ - class ListQueuesRequest implements IListQueuesRequest { - - /** - * Constructs a new ListQueuesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IListQueuesRequest); - - /** ListQueuesRequest parent. */ - public parent: string; - - /** ListQueuesRequest filter. */ - public filter: string; - - /** ListQueuesRequest pageSize. */ - public pageSize: number; - - /** ListQueuesRequest pageToken. */ - public pageToken: string; - - /** ListQueuesRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new ListQueuesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListQueuesRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IListQueuesRequest): google.cloud.tasks.v2beta3.ListQueuesRequest; - - /** - * Encodes the specified ListQueuesRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesRequest.verify|verify} messages. - * @param message ListQueuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IListQueuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListQueuesRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesRequest.verify|verify} messages. - * @param message ListQueuesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IListQueuesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.ListQueuesRequest; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.ListQueuesRequest; - - /** - * Verifies a ListQueuesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListQueuesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListQueuesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.ListQueuesRequest; - - /** - * Creates a plain object from a ListQueuesRequest message. Also converts values to other types if specified. - * @param message ListQueuesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.ListQueuesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListQueuesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListQueuesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListQueuesResponse. */ - interface IListQueuesResponse { - - /** ListQueuesResponse queues */ - queues?: (google.cloud.tasks.v2beta3.IQueue[]|null); - - /** ListQueuesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListQueuesResponse. */ - class ListQueuesResponse implements IListQueuesResponse { - - /** - * Constructs a new ListQueuesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IListQueuesResponse); - - /** ListQueuesResponse queues. */ - public queues: google.cloud.tasks.v2beta3.IQueue[]; - - /** ListQueuesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListQueuesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListQueuesResponse instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IListQueuesResponse): google.cloud.tasks.v2beta3.ListQueuesResponse; - - /** - * Encodes the specified ListQueuesResponse message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesResponse.verify|verify} messages. - * @param message ListQueuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IListQueuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListQueuesResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesResponse.verify|verify} messages. - * @param message ListQueuesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IListQueuesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.ListQueuesResponse; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.ListQueuesResponse; - - /** - * Verifies a ListQueuesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListQueuesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListQueuesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.ListQueuesResponse; - - /** - * Creates a plain object from a ListQueuesResponse message. Also converts values to other types if specified. - * @param message ListQueuesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.ListQueuesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListQueuesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListQueuesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetQueueRequest. */ - interface IGetQueueRequest { - - /** GetQueueRequest name */ - name?: (string|null); - - /** GetQueueRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a GetQueueRequest. */ - class GetQueueRequest implements IGetQueueRequest { - - /** - * Constructs a new GetQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IGetQueueRequest); - - /** GetQueueRequest name. */ - public name: string; - - /** GetQueueRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new GetQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IGetQueueRequest): google.cloud.tasks.v2beta3.GetQueueRequest; - - /** - * Encodes the specified GetQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.GetQueueRequest.verify|verify} messages. - * @param message GetQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IGetQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.GetQueueRequest.verify|verify} messages. - * @param message GetQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IGetQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.GetQueueRequest; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.GetQueueRequest; - - /** - * Verifies a GetQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.GetQueueRequest; - - /** - * Creates a plain object from a GetQueueRequest message. Also converts values to other types if specified. - * @param message GetQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.GetQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateQueueRequest. */ - interface ICreateQueueRequest { - - /** CreateQueueRequest parent */ - parent?: (string|null); - - /** CreateQueueRequest queue */ - queue?: (google.cloud.tasks.v2beta3.IQueue|null); - } - - /** Represents a CreateQueueRequest. */ - class CreateQueueRequest implements ICreateQueueRequest { - - /** - * Constructs a new CreateQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.ICreateQueueRequest); - - /** CreateQueueRequest parent. */ - public parent: string; - - /** CreateQueueRequest queue. */ - public queue?: (google.cloud.tasks.v2beta3.IQueue|null); - - /** - * Creates a new CreateQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.ICreateQueueRequest): google.cloud.tasks.v2beta3.CreateQueueRequest; - - /** - * Encodes the specified CreateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateQueueRequest.verify|verify} messages. - * @param message CreateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.ICreateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateQueueRequest.verify|verify} messages. - * @param message CreateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.ICreateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.CreateQueueRequest; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.CreateQueueRequest; - - /** - * Verifies a CreateQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.CreateQueueRequest; - - /** - * Creates a plain object from a CreateQueueRequest message. Also converts values to other types if specified. - * @param message CreateQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.CreateQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateQueueRequest. */ - interface IUpdateQueueRequest { - - /** UpdateQueueRequest queue */ - queue?: (google.cloud.tasks.v2beta3.IQueue|null); - - /** UpdateQueueRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateQueueRequest. */ - class UpdateQueueRequest implements IUpdateQueueRequest { - - /** - * Constructs a new UpdateQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IUpdateQueueRequest); - - /** UpdateQueueRequest queue. */ - public queue?: (google.cloud.tasks.v2beta3.IQueue|null); - - /** UpdateQueueRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IUpdateQueueRequest): google.cloud.tasks.v2beta3.UpdateQueueRequest; - - /** - * Encodes the specified UpdateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.UpdateQueueRequest.verify|verify} messages. - * @param message UpdateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IUpdateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.UpdateQueueRequest.verify|verify} messages. - * @param message UpdateQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IUpdateQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.UpdateQueueRequest; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.UpdateQueueRequest; - - /** - * Verifies an UpdateQueueRequest message. - * @param message Plain 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 UpdateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.UpdateQueueRequest; - - /** - * Creates a plain object from an UpdateQueueRequest message. Also converts values to other types if specified. - * @param message UpdateQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.UpdateQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteQueueRequest. */ - interface IDeleteQueueRequest { - - /** DeleteQueueRequest name */ - name?: (string|null); - } - - /** Represents a DeleteQueueRequest. */ - class DeleteQueueRequest implements IDeleteQueueRequest { - - /** - * Constructs a new DeleteQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IDeleteQueueRequest); - - /** DeleteQueueRequest name. */ - public name: string; - - /** - * Creates a new DeleteQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IDeleteQueueRequest): google.cloud.tasks.v2beta3.DeleteQueueRequest; - - /** - * Encodes the specified DeleteQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteQueueRequest.verify|verify} messages. - * @param message DeleteQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IDeleteQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteQueueRequest.verify|verify} messages. - * @param message DeleteQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IDeleteQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.DeleteQueueRequest; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.DeleteQueueRequest; - - /** - * Verifies a DeleteQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.DeleteQueueRequest; - - /** - * Creates a plain object from a DeleteQueueRequest message. Also converts values to other types if specified. - * @param message DeleteQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.DeleteQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PurgeQueueRequest. */ - interface IPurgeQueueRequest { - - /** PurgeQueueRequest name */ - name?: (string|null); - } - - /** Represents a PurgeQueueRequest. */ - class PurgeQueueRequest implements IPurgeQueueRequest { - - /** - * Constructs a new PurgeQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IPurgeQueueRequest); - - /** PurgeQueueRequest name. */ - public name: string; - - /** - * Creates a new PurgeQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PurgeQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IPurgeQueueRequest): google.cloud.tasks.v2beta3.PurgeQueueRequest; - - /** - * Encodes the specified PurgeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.PurgeQueueRequest.verify|verify} messages. - * @param message PurgeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IPurgeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PurgeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.PurgeQueueRequest.verify|verify} messages. - * @param message PurgeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IPurgeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.PurgeQueueRequest; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.PurgeQueueRequest; - - /** - * Verifies a PurgeQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PurgeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PurgeQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.PurgeQueueRequest; - - /** - * Creates a plain object from a PurgeQueueRequest message. Also converts values to other types if specified. - * @param message PurgeQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.PurgeQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PurgeQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PurgeQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PauseQueueRequest. */ - interface IPauseQueueRequest { - - /** PauseQueueRequest name */ - name?: (string|null); - } - - /** Represents a PauseQueueRequest. */ - class PauseQueueRequest implements IPauseQueueRequest { - - /** - * Constructs a new PauseQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IPauseQueueRequest); - - /** PauseQueueRequest name. */ - public name: string; - - /** - * Creates a new PauseQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns PauseQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IPauseQueueRequest): google.cloud.tasks.v2beta3.PauseQueueRequest; - - /** - * Encodes the specified PauseQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.PauseQueueRequest.verify|verify} messages. - * @param message PauseQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IPauseQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PauseQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.PauseQueueRequest.verify|verify} messages. - * @param message PauseQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IPauseQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.PauseQueueRequest; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.PauseQueueRequest; - - /** - * Verifies a PauseQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PauseQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PauseQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.PauseQueueRequest; - - /** - * Creates a plain object from a PauseQueueRequest message. Also converts values to other types if specified. - * @param message PauseQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.PauseQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PauseQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PauseQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResumeQueueRequest. */ - interface IResumeQueueRequest { - - /** ResumeQueueRequest name */ - name?: (string|null); - } - - /** Represents a ResumeQueueRequest. */ - class ResumeQueueRequest implements IResumeQueueRequest { - - /** - * Constructs a new ResumeQueueRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IResumeQueueRequest); - - /** ResumeQueueRequest name. */ - public name: string; - - /** - * Creates a new ResumeQueueRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ResumeQueueRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IResumeQueueRequest): google.cloud.tasks.v2beta3.ResumeQueueRequest; - - /** - * Encodes the specified ResumeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.ResumeQueueRequest.verify|verify} messages. - * @param message ResumeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IResumeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResumeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ResumeQueueRequest.verify|verify} messages. - * @param message ResumeQueueRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IResumeQueueRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.ResumeQueueRequest; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.ResumeQueueRequest; - - /** - * Verifies a ResumeQueueRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResumeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResumeQueueRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.ResumeQueueRequest; - - /** - * Creates a plain object from a ResumeQueueRequest message. Also converts values to other types if specified. - * @param message ResumeQueueRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.ResumeQueueRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResumeQueueRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResumeQueueRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksRequest. */ - interface IListTasksRequest { - - /** ListTasksRequest parent */ - parent?: (string|null); - - /** ListTasksRequest responseView */ - responseView?: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View|null); - - /** ListTasksRequest pageSize */ - pageSize?: (number|null); - - /** ListTasksRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListTasksRequest. */ - class ListTasksRequest implements IListTasksRequest { - - /** - * Constructs a new ListTasksRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IListTasksRequest); - - /** ListTasksRequest parent. */ - public parent: string; - - /** ListTasksRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View); - - /** ListTasksRequest pageSize. */ - public pageSize: number; - - /** ListTasksRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IListTasksRequest): google.cloud.tasks.v2beta3.ListTasksRequest; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksRequest.verify|verify} messages. - * @param message ListTasksRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IListTasksRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.ListTasksRequest; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.ListTasksRequest; - - /** - * Verifies a ListTasksRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.ListTasksRequest; - - /** - * Creates a plain object from a ListTasksRequest message. Also converts values to other types if specified. - * @param message ListTasksRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.ListTasksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListTasksResponse. */ - interface IListTasksResponse { - - /** ListTasksResponse tasks */ - tasks?: (google.cloud.tasks.v2beta3.ITask[]|null); - - /** ListTasksResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListTasksResponse. */ - class ListTasksResponse implements IListTasksResponse { - - /** - * Constructs a new ListTasksResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IListTasksResponse); - - /** ListTasksResponse tasks. */ - public tasks: google.cloud.tasks.v2beta3.ITask[]; - - /** ListTasksResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListTasksResponse instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IListTasksResponse): google.cloud.tasks.v2beta3.ListTasksResponse; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksResponse.verify|verify} messages. - * @param message ListTasksResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IListTasksResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.ListTasksResponse; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.ListTasksResponse; - - /** - * Verifies a ListTasksResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListTasksResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.ListTasksResponse; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @param message ListTasksResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.ListTasksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListTasksResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListTasksResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetTaskRequest. */ - interface IGetTaskRequest { - - /** GetTaskRequest name */ - name?: (string|null); - - /** GetTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View|null); - } - - /** Represents a GetTaskRequest. */ - class GetTaskRequest implements IGetTaskRequest { - - /** - * Constructs a new GetTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IGetTaskRequest); - - /** GetTaskRequest name. */ - public name: string; - - /** GetTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View); - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IGetTaskRequest): google.cloud.tasks.v2beta3.GetTaskRequest; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.GetTaskRequest.verify|verify} messages. - * @param message GetTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IGetTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.GetTaskRequest; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.GetTaskRequest; - - /** - * Verifies a GetTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.GetTaskRequest; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @param message GetTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.GetTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateTaskRequest. */ - interface ICreateTaskRequest { - - /** CreateTaskRequest parent */ - parent?: (string|null); - - /** CreateTaskRequest task */ - task?: (google.cloud.tasks.v2beta3.ITask|null); - - /** CreateTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View|null); - } - - /** Represents a CreateTaskRequest. */ - class CreateTaskRequest implements ICreateTaskRequest { - - /** - * Constructs a new CreateTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.ICreateTaskRequest); - - /** CreateTaskRequest parent. */ - public parent: string; - - /** CreateTaskRequest task. */ - public task?: (google.cloud.tasks.v2beta3.ITask|null); - - /** CreateTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View); - - /** - * Creates a new CreateTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.ICreateTaskRequest): google.cloud.tasks.v2beta3.CreateTaskRequest; - - /** - * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateTaskRequest.verify|verify} messages. - * @param message CreateTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateTaskRequest.verify|verify} messages. - * @param message CreateTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.ICreateTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.CreateTaskRequest; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.CreateTaskRequest; - - /** - * Verifies a CreateTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.CreateTaskRequest; - - /** - * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. - * @param message CreateTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.CreateTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteTaskRequest. */ - interface IDeleteTaskRequest { - - /** DeleteTaskRequest name */ - name?: (string|null); - } - - /** Represents a DeleteTaskRequest. */ - class DeleteTaskRequest implements IDeleteTaskRequest { - - /** - * Constructs a new DeleteTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IDeleteTaskRequest); - - /** DeleteTaskRequest name. */ - public name: string; - - /** - * Creates a new DeleteTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IDeleteTaskRequest): google.cloud.tasks.v2beta3.DeleteTaskRequest; - - /** - * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteTaskRequest.verify|verify} messages. - * @param message DeleteTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteTaskRequest.verify|verify} messages. - * @param message DeleteTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IDeleteTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.DeleteTaskRequest; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.DeleteTaskRequest; - - /** - * Verifies a DeleteTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.DeleteTaskRequest; - - /** - * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. - * @param message DeleteTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.DeleteTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunTaskRequest. */ - interface IRunTaskRequest { - - /** RunTaskRequest name */ - name?: (string|null); - - /** RunTaskRequest responseView */ - responseView?: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View|null); - } - - /** Represents a RunTaskRequest. */ - class RunTaskRequest implements IRunTaskRequest { - - /** - * Constructs a new RunTaskRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IRunTaskRequest); - - /** RunTaskRequest name. */ - public name: string; - - /** RunTaskRequest responseView. */ - public responseView: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View); - - /** - * Creates a new RunTaskRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunTaskRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IRunTaskRequest): google.cloud.tasks.v2beta3.RunTaskRequest; - - /** - * Encodes the specified RunTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.RunTaskRequest.verify|verify} messages. - * @param message RunTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IRunTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RunTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.RunTaskRequest.verify|verify} messages. - * @param message RunTaskRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IRunTaskRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.RunTaskRequest; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.RunTaskRequest; - - /** - * Verifies a RunTaskRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RunTaskRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunTaskRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.RunTaskRequest; - - /** - * Creates a plain object from a RunTaskRequest message. Also converts values to other types if specified. - * @param message RunTaskRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.RunTaskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RunTaskRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunTaskRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Queue. */ - interface IQueue { - - /** Queue name */ - name?: (string|null); - - /** Queue appEngineHttpQueue */ - appEngineHttpQueue?: (google.cloud.tasks.v2beta3.IAppEngineHttpQueue|null); - - /** Queue rateLimits */ - rateLimits?: (google.cloud.tasks.v2beta3.IRateLimits|null); - - /** Queue retryConfig */ - retryConfig?: (google.cloud.tasks.v2beta3.IRetryConfig|null); - - /** Queue state */ - state?: (google.cloud.tasks.v2beta3.Queue.State|keyof typeof google.cloud.tasks.v2beta3.Queue.State|null); - - /** Queue purgeTime */ - purgeTime?: (google.protobuf.ITimestamp|null); - - /** Queue taskTtl */ - taskTtl?: (google.protobuf.IDuration|null); - - /** Queue tombstoneTtl */ - tombstoneTtl?: (google.protobuf.IDuration|null); - - /** Queue stackdriverLoggingConfig */ - stackdriverLoggingConfig?: (google.cloud.tasks.v2beta3.IStackdriverLoggingConfig|null); - - /** Queue type */ - type?: (google.cloud.tasks.v2beta3.Queue.Type|keyof typeof google.cloud.tasks.v2beta3.Queue.Type|null); - - /** Queue stats */ - stats?: (google.cloud.tasks.v2beta3.IQueueStats|null); - } - - /** Represents a Queue. */ - class Queue implements IQueue { - - /** - * Constructs a new Queue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IQueue); - - /** Queue name. */ - public name: string; - - /** Queue appEngineHttpQueue. */ - public appEngineHttpQueue?: (google.cloud.tasks.v2beta3.IAppEngineHttpQueue|null); - - /** Queue rateLimits. */ - public rateLimits?: (google.cloud.tasks.v2beta3.IRateLimits|null); - - /** Queue retryConfig. */ - public retryConfig?: (google.cloud.tasks.v2beta3.IRetryConfig|null); - - /** Queue state. */ - public state: (google.cloud.tasks.v2beta3.Queue.State|keyof typeof google.cloud.tasks.v2beta3.Queue.State); - - /** Queue purgeTime. */ - public purgeTime?: (google.protobuf.ITimestamp|null); - - /** Queue taskTtl. */ - public taskTtl?: (google.protobuf.IDuration|null); - - /** Queue tombstoneTtl. */ - public tombstoneTtl?: (google.protobuf.IDuration|null); - - /** Queue stackdriverLoggingConfig. */ - public stackdriverLoggingConfig?: (google.cloud.tasks.v2beta3.IStackdriverLoggingConfig|null); - - /** Queue type. */ - public type: (google.cloud.tasks.v2beta3.Queue.Type|keyof typeof google.cloud.tasks.v2beta3.Queue.Type); - - /** Queue stats. */ - public stats?: (google.cloud.tasks.v2beta3.IQueueStats|null); - - /** Queue queueType. */ - public queueType?: "appEngineHttpQueue"; - - /** - * Creates a new Queue instance using the specified properties. - * @param [properties] Properties to set - * @returns Queue instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IQueue): google.cloud.tasks.v2beta3.Queue; - - /** - * Encodes the specified Queue message. Does not implicitly {@link google.cloud.tasks.v2beta3.Queue.verify|verify} messages. - * @param message Queue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Queue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.Queue.verify|verify} messages. - * @param message Queue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Queue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.Queue; - - /** - * Decodes a Queue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.Queue; - - /** - * Verifies a Queue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Queue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Queue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.Queue; - - /** - * Creates a plain object from a Queue message. Also converts values to other types if specified. - * @param message Queue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.Queue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Queue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Queue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Queue { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - RUNNING = 1, - PAUSED = 2, - DISABLED = 3 - } - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - PULL = 1, - PUSH = 2 - } - } - - /** Properties of a RateLimits. */ - interface IRateLimits { - - /** RateLimits maxDispatchesPerSecond */ - maxDispatchesPerSecond?: (number|null); - - /** RateLimits maxBurstSize */ - maxBurstSize?: (number|null); - - /** RateLimits maxConcurrentDispatches */ - maxConcurrentDispatches?: (number|null); - } - - /** Represents a RateLimits. */ - class RateLimits implements IRateLimits { - - /** - * Constructs a new RateLimits. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IRateLimits); - - /** RateLimits maxDispatchesPerSecond. */ - public maxDispatchesPerSecond: number; - - /** RateLimits maxBurstSize. */ - public maxBurstSize: number; - - /** RateLimits maxConcurrentDispatches. */ - public maxConcurrentDispatches: number; - - /** - * Creates a new RateLimits instance using the specified properties. - * @param [properties] Properties to set - * @returns RateLimits instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IRateLimits): google.cloud.tasks.v2beta3.RateLimits; - - /** - * Encodes the specified RateLimits message. Does not implicitly {@link google.cloud.tasks.v2beta3.RateLimits.verify|verify} messages. - * @param message RateLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IRateLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RateLimits message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.RateLimits.verify|verify} messages. - * @param message RateLimits message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IRateLimits, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RateLimits message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.RateLimits; - - /** - * Decodes a RateLimits message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.RateLimits; - - /** - * Verifies a RateLimits message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RateLimits message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RateLimits - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.RateLimits; - - /** - * Creates a plain object from a RateLimits message. Also converts values to other types if specified. - * @param message RateLimits - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.RateLimits, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RateLimits to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RateLimits - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RetryConfig. */ - interface IRetryConfig { - - /** RetryConfig maxAttempts */ - maxAttempts?: (number|null); - - /** RetryConfig maxRetryDuration */ - maxRetryDuration?: (google.protobuf.IDuration|null); - - /** RetryConfig minBackoff */ - minBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxBackoff */ - maxBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxDoublings */ - maxDoublings?: (number|null); - } - - /** Represents a RetryConfig. */ - class RetryConfig implements IRetryConfig { - - /** - * Constructs a new RetryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IRetryConfig); - - /** RetryConfig maxAttempts. */ - public maxAttempts: number; - - /** RetryConfig maxRetryDuration. */ - public maxRetryDuration?: (google.protobuf.IDuration|null); - - /** RetryConfig minBackoff. */ - public minBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxBackoff. */ - public maxBackoff?: (google.protobuf.IDuration|null); - - /** RetryConfig maxDoublings. */ - public maxDoublings: number; - - /** - * Creates a new RetryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RetryConfig instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IRetryConfig): google.cloud.tasks.v2beta3.RetryConfig; - - /** - * Encodes the specified RetryConfig message. Does not implicitly {@link google.cloud.tasks.v2beta3.RetryConfig.verify|verify} messages. - * @param message RetryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IRetryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RetryConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.RetryConfig.verify|verify} messages. - * @param message RetryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IRetryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RetryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.RetryConfig; - - /** - * Decodes a RetryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.RetryConfig; - - /** - * Verifies a RetryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RetryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RetryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.RetryConfig; - - /** - * Creates a plain object from a RetryConfig message. Also converts values to other types if specified. - * @param message RetryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.RetryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RetryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RetryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StackdriverLoggingConfig. */ - interface IStackdriverLoggingConfig { - - /** StackdriverLoggingConfig samplingRatio */ - samplingRatio?: (number|null); - } - - /** Represents a StackdriverLoggingConfig. */ - class StackdriverLoggingConfig implements IStackdriverLoggingConfig { - - /** - * Constructs a new StackdriverLoggingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IStackdriverLoggingConfig); - - /** StackdriverLoggingConfig samplingRatio. */ - public samplingRatio: number; - - /** - * Creates a new StackdriverLoggingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns StackdriverLoggingConfig instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IStackdriverLoggingConfig): google.cloud.tasks.v2beta3.StackdriverLoggingConfig; - - /** - * Encodes the specified StackdriverLoggingConfig message. Does not implicitly {@link google.cloud.tasks.v2beta3.StackdriverLoggingConfig.verify|verify} messages. - * @param message StackdriverLoggingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IStackdriverLoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StackdriverLoggingConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.StackdriverLoggingConfig.verify|verify} messages. - * @param message StackdriverLoggingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IStackdriverLoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.StackdriverLoggingConfig; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.StackdriverLoggingConfig; - - /** - * Verifies a StackdriverLoggingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StackdriverLoggingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StackdriverLoggingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.StackdriverLoggingConfig; - - /** - * Creates a plain object from a StackdriverLoggingConfig message. Also converts values to other types if specified. - * @param message StackdriverLoggingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.StackdriverLoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StackdriverLoggingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StackdriverLoggingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueueStats. */ - interface IQueueStats { - - /** QueueStats tasksCount */ - tasksCount?: (number|Long|string|null); - - /** QueueStats oldestEstimatedArrivalTime */ - oldestEstimatedArrivalTime?: (google.protobuf.ITimestamp|null); - - /** QueueStats executedLastMinuteCount */ - executedLastMinuteCount?: (number|Long|string|null); - - /** QueueStats concurrentDispatchesCount */ - concurrentDispatchesCount?: (number|Long|string|null); - - /** QueueStats effectiveExecutionRate */ - effectiveExecutionRate?: (number|null); - } - - /** Represents a QueueStats. */ - class QueueStats implements IQueueStats { - - /** - * Constructs a new QueueStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IQueueStats); - - /** QueueStats tasksCount. */ - public tasksCount: (number|Long|string); - - /** QueueStats oldestEstimatedArrivalTime. */ - public oldestEstimatedArrivalTime?: (google.protobuf.ITimestamp|null); - - /** QueueStats executedLastMinuteCount. */ - public executedLastMinuteCount: (number|Long|string); - - /** QueueStats concurrentDispatchesCount. */ - public concurrentDispatchesCount: (number|Long|string); - - /** QueueStats effectiveExecutionRate. */ - public effectiveExecutionRate: number; - - /** - * Creates a new QueueStats instance using the specified properties. - * @param [properties] Properties to set - * @returns QueueStats instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IQueueStats): google.cloud.tasks.v2beta3.QueueStats; - - /** - * Encodes the specified QueueStats message. Does not implicitly {@link google.cloud.tasks.v2beta3.QueueStats.verify|verify} messages. - * @param message QueueStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IQueueStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueueStats message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.QueueStats.verify|verify} messages. - * @param message QueueStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IQueueStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueueStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.QueueStats; - - /** - * Decodes a QueueStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.QueueStats; - - /** - * Verifies a QueueStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueueStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueueStats - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.QueueStats; - - /** - * Creates a plain object from a QueueStats message. Also converts values to other types if specified. - * @param message QueueStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.QueueStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueueStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueueStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PullMessage. */ - interface IPullMessage { - - /** PullMessage payload */ - payload?: (Uint8Array|string|null); - - /** PullMessage tag */ - tag?: (string|null); - } - - /** Represents a PullMessage. */ - class PullMessage implements IPullMessage { - - /** - * Constructs a new PullMessage. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IPullMessage); - - /** PullMessage payload. */ - public payload: (Uint8Array|string); - - /** PullMessage tag. */ - public tag: string; - - /** - * Creates a new PullMessage instance using the specified properties. - * @param [properties] Properties to set - * @returns PullMessage instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IPullMessage): google.cloud.tasks.v2beta3.PullMessage; - - /** - * Encodes the specified PullMessage message. Does not implicitly {@link google.cloud.tasks.v2beta3.PullMessage.verify|verify} messages. - * @param message PullMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IPullMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PullMessage message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.PullMessage.verify|verify} messages. - * @param message PullMessage message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IPullMessage, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PullMessage message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.PullMessage; - - /** - * Decodes a PullMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.PullMessage; - - /** - * Verifies a PullMessage message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PullMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PullMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.PullMessage; - - /** - * Creates a plain object from a PullMessage message. Also converts values to other types if specified. - * @param message PullMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.PullMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PullMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PullMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRequest. */ - interface IHttpRequest { - - /** HttpRequest url */ - url?: (string|null); - - /** HttpRequest httpMethod */ - httpMethod?: (google.cloud.tasks.v2beta3.HttpMethod|keyof typeof google.cloud.tasks.v2beta3.HttpMethod|null); - - /** HttpRequest headers */ - headers?: ({ [k: string]: string }|null); - - /** HttpRequest body */ - body?: (Uint8Array|string|null); - - /** HttpRequest oauthToken */ - oauthToken?: (google.cloud.tasks.v2beta3.IOAuthToken|null); - - /** HttpRequest oidcToken */ - oidcToken?: (google.cloud.tasks.v2beta3.IOidcToken|null); - } - - /** Represents a HttpRequest. */ - class HttpRequest implements IHttpRequest { - - /** - * Constructs a new HttpRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IHttpRequest); - - /** HttpRequest url. */ - public url: string; - - /** HttpRequest httpMethod. */ - public httpMethod: (google.cloud.tasks.v2beta3.HttpMethod|keyof typeof google.cloud.tasks.v2beta3.HttpMethod); - - /** HttpRequest headers. */ - public headers: { [k: string]: string }; - - /** HttpRequest body. */ - public body: (Uint8Array|string); - - /** HttpRequest oauthToken. */ - public oauthToken?: (google.cloud.tasks.v2beta3.IOAuthToken|null); - - /** HttpRequest oidcToken. */ - public oidcToken?: (google.cloud.tasks.v2beta3.IOidcToken|null); - - /** HttpRequest authorizationHeader. */ - public authorizationHeader?: ("oauthToken"|"oidcToken"); - - /** - * Creates a new HttpRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IHttpRequest): google.cloud.tasks.v2beta3.HttpRequest; - - /** - * Encodes the specified HttpRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.HttpRequest.verify|verify} messages. - * @param message HttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.HttpRequest.verify|verify} messages. - * @param message HttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.HttpRequest; - - /** - * Decodes a HttpRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.HttpRequest; - - /** - * Verifies a HttpRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.HttpRequest; - - /** - * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. - * @param message HttpRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.HttpRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineHttpQueue. */ - interface IAppEngineHttpQueue { - - /** AppEngineHttpQueue appEngineRoutingOverride */ - appEngineRoutingOverride?: (google.cloud.tasks.v2beta3.IAppEngineRouting|null); - } - - /** Represents an AppEngineHttpQueue. */ - class AppEngineHttpQueue implements IAppEngineHttpQueue { - - /** - * Constructs a new AppEngineHttpQueue. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IAppEngineHttpQueue); - - /** AppEngineHttpQueue appEngineRoutingOverride. */ - public appEngineRoutingOverride?: (google.cloud.tasks.v2beta3.IAppEngineRouting|null); - - /** - * Creates a new AppEngineHttpQueue instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineHttpQueue instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IAppEngineHttpQueue): google.cloud.tasks.v2beta3.AppEngineHttpQueue; - - /** - * Encodes the specified AppEngineHttpQueue message. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpQueue.verify|verify} messages. - * @param message AppEngineHttpQueue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IAppEngineHttpQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineHttpQueue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpQueue.verify|verify} messages. - * @param message AppEngineHttpQueue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IAppEngineHttpQueue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineHttpQueue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineHttpQueue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.AppEngineHttpQueue; - - /** - * Decodes an AppEngineHttpQueue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineHttpQueue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.AppEngineHttpQueue; - - /** - * Verifies an AppEngineHttpQueue message. - * @param message Plain 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 AppEngineHttpQueue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineHttpQueue - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.AppEngineHttpQueue; - - /** - * Creates a plain object from an AppEngineHttpQueue message. Also converts values to other types if specified. - * @param message AppEngineHttpQueue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.AppEngineHttpQueue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineHttpQueue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineHttpQueue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineHttpRequest. */ - interface IAppEngineHttpRequest { - - /** AppEngineHttpRequest httpMethod */ - httpMethod?: (google.cloud.tasks.v2beta3.HttpMethod|keyof typeof google.cloud.tasks.v2beta3.HttpMethod|null); - - /** AppEngineHttpRequest appEngineRouting */ - appEngineRouting?: (google.cloud.tasks.v2beta3.IAppEngineRouting|null); - - /** AppEngineHttpRequest relativeUri */ - relativeUri?: (string|null); - - /** AppEngineHttpRequest headers */ - headers?: ({ [k: string]: string }|null); - - /** AppEngineHttpRequest body */ - body?: (Uint8Array|string|null); - } - - /** Represents an AppEngineHttpRequest. */ - class AppEngineHttpRequest implements IAppEngineHttpRequest { - - /** - * Constructs a new AppEngineHttpRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IAppEngineHttpRequest); - - /** AppEngineHttpRequest httpMethod. */ - public httpMethod: (google.cloud.tasks.v2beta3.HttpMethod|keyof typeof google.cloud.tasks.v2beta3.HttpMethod); - - /** AppEngineHttpRequest appEngineRouting. */ - public appEngineRouting?: (google.cloud.tasks.v2beta3.IAppEngineRouting|null); - - /** AppEngineHttpRequest relativeUri. */ - public relativeUri: string; - - /** AppEngineHttpRequest headers. */ - public headers: { [k: string]: string }; - - /** AppEngineHttpRequest body. */ - public body: (Uint8Array|string); - - /** - * Creates a new AppEngineHttpRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineHttpRequest instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IAppEngineHttpRequest): google.cloud.tasks.v2beta3.AppEngineHttpRequest; - - /** - * Encodes the specified AppEngineHttpRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpRequest.verify|verify} messages. - * @param message AppEngineHttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IAppEngineHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineHttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpRequest.verify|verify} messages. - * @param message AppEngineHttpRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IAppEngineHttpRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.AppEngineHttpRequest; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.AppEngineHttpRequest; - - /** - * Verifies an AppEngineHttpRequest message. - * @param message Plain 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 AppEngineHttpRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineHttpRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.AppEngineHttpRequest; - - /** - * Creates a plain object from an AppEngineHttpRequest message. Also converts values to other types if specified. - * @param message AppEngineHttpRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.AppEngineHttpRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineHttpRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineHttpRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AppEngineRouting. */ - interface IAppEngineRouting { - - /** AppEngineRouting service */ - service?: (string|null); - - /** AppEngineRouting version */ - version?: (string|null); - - /** AppEngineRouting instance */ - instance?: (string|null); - - /** AppEngineRouting host */ - host?: (string|null); - } - - /** Represents an AppEngineRouting. */ - class AppEngineRouting implements IAppEngineRouting { - - /** - * Constructs a new AppEngineRouting. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IAppEngineRouting); - - /** AppEngineRouting service. */ - public service: string; - - /** AppEngineRouting version. */ - public version: string; - - /** AppEngineRouting instance. */ - public instance: string; - - /** AppEngineRouting host. */ - public host: string; - - /** - * Creates a new AppEngineRouting instance using the specified properties. - * @param [properties] Properties to set - * @returns AppEngineRouting instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IAppEngineRouting): google.cloud.tasks.v2beta3.AppEngineRouting; - - /** - * Encodes the specified AppEngineRouting message. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineRouting.verify|verify} messages. - * @param message AppEngineRouting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IAppEngineRouting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AppEngineRouting message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineRouting.verify|verify} messages. - * @param message AppEngineRouting message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IAppEngineRouting, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.AppEngineRouting; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.AppEngineRouting; - - /** - * Verifies an AppEngineRouting message. - * @param message Plain 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 AppEngineRouting message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AppEngineRouting - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.AppEngineRouting; - - /** - * Creates a plain object from an AppEngineRouting message. Also converts values to other types if specified. - * @param message AppEngineRouting - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.AppEngineRouting, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AppEngineRouting to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AppEngineRouting - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** HttpMethod enum. */ - enum HttpMethod { - HTTP_METHOD_UNSPECIFIED = 0, - POST = 1, - GET = 2, - HEAD = 3, - PUT = 4, - DELETE = 5, - PATCH = 6, - OPTIONS = 7 - } - - /** Properties of a OAuthToken. */ - interface IOAuthToken { - - /** OAuthToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** OAuthToken scope */ - scope?: (string|null); - } - - /** Represents a OAuthToken. */ - class OAuthToken implements IOAuthToken { - - /** - * Constructs a new OAuthToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IOAuthToken); - - /** OAuthToken serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** OAuthToken scope. */ - public scope: string; - - /** - * Creates a new OAuthToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OAuthToken instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IOAuthToken): google.cloud.tasks.v2beta3.OAuthToken; - - /** - * Encodes the specified OAuthToken message. Does not implicitly {@link google.cloud.tasks.v2beta3.OAuthToken.verify|verify} messages. - * @param message OAuthToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IOAuthToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OAuthToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.OAuthToken.verify|verify} messages. - * @param message OAuthToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IOAuthToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a OAuthToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.OAuthToken; - - /** - * Decodes a OAuthToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.OAuthToken; - - /** - * Verifies a OAuthToken message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a OAuthToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OAuthToken - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.OAuthToken; - - /** - * Creates a plain object from a OAuthToken message. Also converts values to other types if specified. - * @param message OAuthToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.OAuthToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OAuthToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OAuthToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OidcToken. */ - interface IOidcToken { - - /** OidcToken serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** OidcToken audience */ - audience?: (string|null); - } - - /** Represents an OidcToken. */ - class OidcToken implements IOidcToken { - - /** - * Constructs a new OidcToken. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IOidcToken); - - /** OidcToken serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** OidcToken audience. */ - public audience: string; - - /** - * Creates a new OidcToken instance using the specified properties. - * @param [properties] Properties to set - * @returns OidcToken instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IOidcToken): google.cloud.tasks.v2beta3.OidcToken; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.cloud.tasks.v2beta3.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.OidcToken.verify|verify} messages. - * @param message OidcToken message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IOidcToken, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.OidcToken; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.OidcToken; - - /** - * Verifies an OidcToken message. - * @param message Plain 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 OidcToken message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OidcToken - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.OidcToken; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @param message OidcToken - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.OidcToken, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OidcToken to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OidcToken - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Task. */ - interface ITask { - - /** Task name */ - name?: (string|null); - - /** Task appEngineHttpRequest */ - appEngineHttpRequest?: (google.cloud.tasks.v2beta3.IAppEngineHttpRequest|null); - - /** Task httpRequest */ - httpRequest?: (google.cloud.tasks.v2beta3.IHttpRequest|null); - - /** Task pullMessage */ - pullMessage?: (google.cloud.tasks.v2beta3.IPullMessage|null); - - /** Task scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Task createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Task dispatchDeadline */ - dispatchDeadline?: (google.protobuf.IDuration|null); - - /** Task dispatchCount */ - dispatchCount?: (number|null); - - /** Task responseCount */ - responseCount?: (number|null); - - /** Task firstAttempt */ - firstAttempt?: (google.cloud.tasks.v2beta3.IAttempt|null); - - /** Task lastAttempt */ - lastAttempt?: (google.cloud.tasks.v2beta3.IAttempt|null); - - /** Task view */ - view?: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View|null); - } - - /** Represents a Task. */ - class Task implements ITask { - - /** - * Constructs a new Task. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.ITask); - - /** Task name. */ - public name: string; - - /** Task appEngineHttpRequest. */ - public appEngineHttpRequest?: (google.cloud.tasks.v2beta3.IAppEngineHttpRequest|null); - - /** Task httpRequest. */ - public httpRequest?: (google.cloud.tasks.v2beta3.IHttpRequest|null); - - /** Task pullMessage. */ - public pullMessage?: (google.cloud.tasks.v2beta3.IPullMessage|null); - - /** Task scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Task createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Task dispatchDeadline. */ - public dispatchDeadline?: (google.protobuf.IDuration|null); - - /** Task dispatchCount. */ - public dispatchCount: number; - - /** Task responseCount. */ - public responseCount: number; - - /** Task firstAttempt. */ - public firstAttempt?: (google.cloud.tasks.v2beta3.IAttempt|null); - - /** Task lastAttempt. */ - public lastAttempt?: (google.cloud.tasks.v2beta3.IAttempt|null); - - /** Task view. */ - public view: (google.cloud.tasks.v2beta3.Task.View|keyof typeof google.cloud.tasks.v2beta3.Task.View); - - /** Task payloadType. */ - public payloadType?: ("appEngineHttpRequest"|"httpRequest"|"pullMessage"); - - /** - * Creates a new Task instance using the specified properties. - * @param [properties] Properties to set - * @returns Task instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.ITask): google.cloud.tasks.v2beta3.Task; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.tasks.v2beta3.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.Task.verify|verify} messages. - * @param message Task message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.ITask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Task message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.Task; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.Task; - - /** - * Verifies a Task message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Task - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.Task; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @param message Task - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.Task, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Task to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Task - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Task { - - /** View enum. */ - enum View { - VIEW_UNSPECIFIED = 0, - BASIC = 1, - FULL = 2 - } - } - - /** Properties of an Attempt. */ - interface IAttempt { - - /** Attempt scheduleTime */ - scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Attempt dispatchTime */ - dispatchTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseTime */ - responseTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseStatus */ - responseStatus?: (google.rpc.IStatus|null); - } - - /** Represents an Attempt. */ - class Attempt implements IAttempt { - - /** - * Constructs a new Attempt. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.tasks.v2beta3.IAttempt); - - /** Attempt scheduleTime. */ - public scheduleTime?: (google.protobuf.ITimestamp|null); - - /** Attempt dispatchTime. */ - public dispatchTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseTime. */ - public responseTime?: (google.protobuf.ITimestamp|null); - - /** Attempt responseStatus. */ - public responseStatus?: (google.rpc.IStatus|null); - - /** - * Creates a new Attempt instance using the specified properties. - * @param [properties] Properties to set - * @returns Attempt instance - */ - public static create(properties?: google.cloud.tasks.v2beta3.IAttempt): google.cloud.tasks.v2beta3.Attempt; - - /** - * Encodes the specified Attempt message. Does not implicitly {@link google.cloud.tasks.v2beta3.Attempt.verify|verify} messages. - * @param message Attempt message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.tasks.v2beta3.IAttempt, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attempt message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.Attempt.verify|verify} messages. - * @param message Attempt message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.tasks.v2beta3.IAttempt, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attempt message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.tasks.v2beta3.Attempt; - - /** - * Decodes an Attempt message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.tasks.v2beta3.Attempt; - - /** - * Verifies an Attempt message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Attempt message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attempt - */ - public static fromObject(object: { [k: string]: any }): google.cloud.tasks.v2beta3.Attempt; - - /** - * Creates a plain object from an Attempt message. Also converts values to other types if specified. - * @param message Attempt - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.tasks.v2beta3.Attempt, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attempt to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Attempt - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7 - } - - /** 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; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: string; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of 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 an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace iam. */ - namespace iam { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a IAMPolicy */ - class IAMPolicy extends $protobuf.rpc.Service { - - /** - * Constructs a new IAMPolicy 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 IAMPolicy 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): IAMPolicy; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.SetIamPolicyCallback): void; - - /** - * Calls SetIamPolicy. - * @param request SetIamPolicyRequest message or plain object - * @returns Promise - */ - public setIamPolicy(request: google.iam.v1.ISetIamPolicyRequest): Promise; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Policy - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest, callback: google.iam.v1.IAMPolicy.GetIamPolicyCallback): void; - - /** - * Calls GetIamPolicy. - * @param request GetIamPolicyRequest message or plain object - * @returns Promise - */ - public getIamPolicy(request: google.iam.v1.IGetIamPolicyRequest): Promise; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest, callback: google.iam.v1.IAMPolicy.TestIamPermissionsCallback): void; - - /** - * Calls TestIamPermissions. - * @param request TestIamPermissionsRequest message or plain object - * @returns Promise - */ - public testIamPermissions(request: google.iam.v1.ITestIamPermissionsRequest): Promise; - } - - namespace IAMPolicy { - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type SetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @param error Error, if any - * @param [response] Policy - */ - type GetIamPolicyCallback = (error: (Error|null), response?: google.iam.v1.Policy) => void; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @param error Error, if any - * @param [response] TestIamPermissionsResponse - */ - type TestIamPermissionsCallback = (error: (Error|null), response?: google.iam.v1.TestIamPermissionsResponse) => void; - } - - /** Properties of a SetIamPolicyRequest. */ - interface ISetIamPolicyRequest { - - /** SetIamPolicyRequest resource */ - resource?: (string|null); - - /** SetIamPolicyRequest policy */ - policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a SetIamPolicyRequest. */ - class SetIamPolicyRequest implements ISetIamPolicyRequest { - - /** - * Constructs a new SetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ISetIamPolicyRequest); - - /** SetIamPolicyRequest resource. */ - public resource: string; - - /** SetIamPolicyRequest policy. */ - public policy?: (google.iam.v1.IPolicy|null); - - /** SetIamPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.ISetIamPolicyRequest): google.iam.v1.SetIamPolicyRequest; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @param message SetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ISetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.SetIamPolicyRequest; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.SetIamPolicyRequest; - - /** - * Verifies a SetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.SetIamPolicyRequest; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @param message SetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.SetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIamPolicyRequest. */ - interface IGetIamPolicyRequest { - - /** GetIamPolicyRequest resource */ - resource?: (string|null); - - /** GetIamPolicyRequest options */ - options?: (google.iam.v1.IGetPolicyOptions|null); - } - - /** Represents a GetIamPolicyRequest. */ - class GetIamPolicyRequest implements IGetIamPolicyRequest { - - /** - * Constructs a new GetIamPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetIamPolicyRequest); - - /** GetIamPolicyRequest resource. */ - public resource: string; - - /** GetIamPolicyRequest options. */ - public options?: (google.iam.v1.IGetPolicyOptions|null); - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIamPolicyRequest instance - */ - public static create(properties?: google.iam.v1.IGetIamPolicyRequest): google.iam.v1.GetIamPolicyRequest; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @param message GetIamPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetIamPolicyRequest; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetIamPolicyRequest; - - /** - * Verifies a GetIamPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIamPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetIamPolicyRequest; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @param message GetIamPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsRequest. */ - interface ITestIamPermissionsRequest { - - /** TestIamPermissionsRequest resource */ - resource?: (string|null); - - /** TestIamPermissionsRequest permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsRequest. */ - class TestIamPermissionsRequest implements ITestIamPermissionsRequest { - - /** - * Constructs a new TestIamPermissionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsRequest); - - /** TestIamPermissionsRequest resource. */ - public resource: string; - - /** TestIamPermissionsRequest permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsRequest instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsRequest): google.iam.v1.TestIamPermissionsRequest; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @param message TestIamPermissionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsRequest; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsRequest; - - /** - * Verifies a TestIamPermissionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsRequest; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @param message TestIamPermissionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TestIamPermissionsResponse. */ - interface ITestIamPermissionsResponse { - - /** TestIamPermissionsResponse permissions */ - permissions?: (string[]|null); - } - - /** Represents a TestIamPermissionsResponse. */ - class TestIamPermissionsResponse implements ITestIamPermissionsResponse { - - /** - * Constructs a new TestIamPermissionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.ITestIamPermissionsResponse); - - /** TestIamPermissionsResponse permissions. */ - public permissions: string[]; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns TestIamPermissionsResponse instance - */ - public static create(properties?: google.iam.v1.ITestIamPermissionsResponse): google.iam.v1.TestIamPermissionsResponse; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @param message TestIamPermissionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.ITestIamPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.TestIamPermissionsResponse; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.TestIamPermissionsResponse; - - /** - * Verifies a TestIamPermissionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TestIamPermissionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.TestIamPermissionsResponse; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @param message TestIamPermissionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.TestIamPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetPolicyOptions. */ - interface IGetPolicyOptions { - - /** GetPolicyOptions requestedPolicyVersion */ - requestedPolicyVersion?: (number|null); - } - - /** Represents a GetPolicyOptions. */ - class GetPolicyOptions implements IGetPolicyOptions { - - /** - * Constructs a new GetPolicyOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IGetPolicyOptions); - - /** GetPolicyOptions requestedPolicyVersion. */ - public requestedPolicyVersion: number; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns GetPolicyOptions instance - */ - public static create(properties?: google.iam.v1.IGetPolicyOptions): google.iam.v1.GetPolicyOptions; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @param message GetPolicyOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IGetPolicyOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.GetPolicyOptions; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.GetPolicyOptions; - - /** - * Verifies a GetPolicyOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetPolicyOptions - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.GetPolicyOptions; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @param message GetPolicyOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.GetPolicyOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetPolicyOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetPolicyOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Policy. */ - interface IPolicy { - - /** Policy version */ - version?: (number|null); - - /** Policy bindings */ - bindings?: (google.iam.v1.IBinding[]|null); - - /** Policy auditConfigs */ - auditConfigs?: (google.iam.v1.IAuditConfig[]|null); - - /** Policy etag */ - etag?: (Uint8Array|string|null); - } - - /** Represents a Policy. */ - class Policy implements IPolicy { - - /** - * Constructs a new Policy. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicy); - - /** Policy version. */ - public version: number; - - /** Policy bindings. */ - public bindings: google.iam.v1.IBinding[]; - - /** Policy auditConfigs. */ - public auditConfigs: google.iam.v1.IAuditConfig[]; - - /** Policy etag. */ - public etag: (Uint8Array|string); - - /** - * Creates a new Policy instance using the specified properties. - * @param [properties] Properties to set - * @returns Policy instance - */ - public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @param message Policy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; - - /** - * Verifies a Policy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Policy - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @param message Policy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Policy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Policy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Binding. */ - interface IBinding { - - /** Binding role */ - role?: (string|null); - - /** Binding members */ - members?: (string[]|null); - - /** Binding condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a Binding. */ - class Binding implements IBinding { - - /** - * Constructs a new Binding. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBinding); - - /** Binding role. */ - public role: string; - - /** Binding members. */ - public members: string[]; - - /** Binding condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new Binding instance using the specified properties. - * @param [properties] Properties to set - * @returns Binding instance - */ - public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @param message Binding message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; - - /** - * Verifies a Binding message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Binding - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @param message Binding - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Binding to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Binding - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditConfig. */ - interface IAuditConfig { - - /** AuditConfig service */ - service?: (string|null); - - /** AuditConfig auditLogConfigs */ - auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); - } - - /** Represents an AuditConfig. */ - class AuditConfig implements IAuditConfig { - - /** - * Constructs a new AuditConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfig); - - /** AuditConfig service. */ - public service: string; - - /** AuditConfig auditLogConfigs. */ - public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfig instance - */ - public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @param message AuditConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; - - /** - * Verifies an AuditConfig message. - * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @param message AuditConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuditLogConfig. */ - interface IAuditLogConfig { - - /** AuditLogConfig logType */ - logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); - - /** AuditLogConfig exemptedMembers */ - exemptedMembers?: (string[]|null); - } - - /** Represents an AuditLogConfig. */ - class AuditLogConfig implements IAuditLogConfig { - - /** - * Constructs a new AuditLogConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditLogConfig); - - /** AuditLogConfig logType. */ - public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); - - /** AuditLogConfig exemptedMembers. */ - public exemptedMembers: string[]; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditLogConfig instance - */ - public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @param message AuditLogConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; - - /** - * Verifies an AuditLogConfig message. - * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditLogConfig - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @param message AuditLogConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditLogConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditLogConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditLogConfig { - - /** LogType enum. */ - enum LogType { - LOG_TYPE_UNSPECIFIED = 0, - ADMIN_READ = 1, - DATA_WRITE = 2, - DATA_READ = 3 - } - } - - /** Properties of a PolicyDelta. */ - interface IPolicyDelta { - - /** PolicyDelta bindingDeltas */ - bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); - - /** PolicyDelta auditConfigDeltas */ - auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); - } - - /** Represents a PolicyDelta. */ - class PolicyDelta implements IPolicyDelta { - - /** - * Constructs a new PolicyDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IPolicyDelta); - - /** PolicyDelta bindingDeltas. */ - public bindingDeltas: google.iam.v1.IBindingDelta[]; - - /** PolicyDelta auditConfigDeltas. */ - public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns PolicyDelta instance - */ - public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @param message PolicyDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; - - /** - * Verifies a PolicyDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PolicyDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @param message PolicyDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PolicyDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PolicyDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BindingDelta. */ - interface IBindingDelta { - - /** BindingDelta action */ - action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); - - /** BindingDelta role */ - role?: (string|null); - - /** BindingDelta member */ - member?: (string|null); - - /** BindingDelta condition */ - condition?: (google.type.IExpr|null); - } - - /** Represents a BindingDelta. */ - class BindingDelta implements IBindingDelta { - - /** - * Constructs a new BindingDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IBindingDelta); - - /** BindingDelta action. */ - public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); - - /** BindingDelta role. */ - public role: string; - - /** BindingDelta member. */ - public member: string; - - /** BindingDelta condition. */ - public condition?: (google.type.IExpr|null); - - /** - * Creates a new BindingDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns BindingDelta instance - */ - public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @param message BindingDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; - - /** - * Verifies a BindingDelta message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BindingDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @param message BindingDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BindingDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BindingDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BindingDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - - /** Properties of an AuditConfigDelta. */ - interface IAuditConfigDelta { - - /** AuditConfigDelta action */ - action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); - - /** AuditConfigDelta service */ - service?: (string|null); - - /** AuditConfigDelta exemptedMember */ - exemptedMember?: (string|null); - - /** AuditConfigDelta logType */ - logType?: (string|null); - } - - /** Represents an AuditConfigDelta. */ - class AuditConfigDelta implements IAuditConfigDelta { - - /** - * Constructs a new AuditConfigDelta. - * @param [properties] Properties to set - */ - constructor(properties?: google.iam.v1.IAuditConfigDelta); - - /** AuditConfigDelta action. */ - public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); - - /** AuditConfigDelta service. */ - public service: string; - - /** AuditConfigDelta exemptedMember. */ - public exemptedMember: string; - - /** AuditConfigDelta logType. */ - public logType: string; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @param [properties] Properties to set - * @returns AuditConfigDelta instance - */ - public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @param message AuditConfigDelta message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; - - /** - * Verifies an AuditConfigDelta message. - * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuditConfigDelta - */ - public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @param message AuditConfigDelta - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuditConfigDelta to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuditConfigDelta - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuditConfigDelta { - - /** Action enum. */ - enum Action { - ACTION_UNSPECIFIED = 0, - ADD = 1, - REMOVE = 2 - } - } - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Expr. */ - interface IExpr { - - /** Expr expression */ - expression?: (string|null); - - /** Expr title */ - title?: (string|null); - - /** Expr description */ - description?: (string|null); - - /** Expr location */ - location?: (string|null); - } - - /** Represents an Expr. */ - class Expr implements IExpr { - - /** - * Constructs a new Expr. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IExpr); - - /** Expr expression. */ - public expression: string; - - /** Expr title. */ - public title: string; - - /** Expr description. */ - public description: string; - - /** Expr location. */ - public location: string; - - /** - * Creates a new Expr instance using the specified properties. - * @param [properties] Properties to set - * @returns Expr instance - */ - public static create(properties?: google.type.IExpr): google.type.Expr; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @param message Expr message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Expr - * @throws {Error} If the payload is not 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.Expr; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Expr - * @throws {Error} If the payload 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.Expr; - - /** - * Verifies an Expr message. - * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Expr - */ - public static fromObject(object: { [k: string]: any }): google.type.Expr; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @param message Expr - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Expr to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Expr - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/protos/protos.js b/protos/protos.js deleted file mode 100644 index 9497e89f..00000000 --- a/protos/protos.js +++ /dev/null @@ -1,42096 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_tasks_protos || ($protobuf.roots._google_cloud_tasks_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.tasks = (function() { - - /** - * Namespace tasks. - * @memberof google.cloud - * @namespace - */ - var tasks = {}; - - tasks.v2 = (function() { - - /** - * Namespace v2. - * @memberof google.cloud.tasks - * @namespace - */ - var v2 = {}; - - v2.CloudTasks = (function() { - - /** - * Constructs a new CloudTasks service. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a CloudTasks - * @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 CloudTasks(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CloudTasks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudTasks; - - /** - * Creates new CloudTasks service using the specified rpc implementation. - * @function create - * @memberof google.cloud.tasks.v2.CloudTasks - * @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 {CloudTasks} RPC service. Useful where requests and/or responses are streamed. - */ - CloudTasks.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|listQueues}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef ListQueuesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.ListQueuesResponse} [response] ListQueuesResponse - */ - - /** - * Calls ListQueues. - * @function listQueues - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IListQueuesRequest} request ListQueuesRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.ListQueuesCallback} callback Node-style callback called with the error, if any, and ListQueuesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.listQueues = function listQueues(request, callback) { - return this.rpcCall(listQueues, $root.google.cloud.tasks.v2.ListQueuesRequest, $root.google.cloud.tasks.v2.ListQueuesResponse, request, callback); - }, "name", { value: "ListQueues" }); - - /** - * Calls ListQueues. - * @function listQueues - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IListQueuesRequest} request ListQueuesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|getQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef GetQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Queue} [response] Queue - */ - - /** - * Calls GetQueue. - * @function getQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IGetQueueRequest} request GetQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.GetQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getQueue = function getQueue(request, callback) { - return this.rpcCall(getQueue, $root.google.cloud.tasks.v2.GetQueueRequest, $root.google.cloud.tasks.v2.Queue, request, callback); - }, "name", { value: "GetQueue" }); - - /** - * Calls GetQueue. - * @function getQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IGetQueueRequest} request GetQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|createQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef CreateQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Queue} [response] Queue - */ - - /** - * Calls CreateQueue. - * @function createQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.ICreateQueueRequest} request CreateQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.CreateQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.createQueue = function createQueue(request, callback) { - return this.rpcCall(createQueue, $root.google.cloud.tasks.v2.CreateQueueRequest, $root.google.cloud.tasks.v2.Queue, request, callback); - }, "name", { value: "CreateQueue" }); - - /** - * Calls CreateQueue. - * @function createQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.ICreateQueueRequest} request CreateQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|updateQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef UpdateQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Queue} [response] Queue - */ - - /** - * Calls UpdateQueue. - * @function updateQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IUpdateQueueRequest} request UpdateQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.UpdateQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.updateQueue = function updateQueue(request, callback) { - return this.rpcCall(updateQueue, $root.google.cloud.tasks.v2.UpdateQueueRequest, $root.google.cloud.tasks.v2.Queue, request, callback); - }, "name", { value: "UpdateQueue" }); - - /** - * Calls UpdateQueue. - * @function updateQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IUpdateQueueRequest} request UpdateQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|deleteQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef DeleteQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteQueue. - * @function deleteQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IDeleteQueueRequest} request DeleteQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.DeleteQueueCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.deleteQueue = function deleteQueue(request, callback) { - return this.rpcCall(deleteQueue, $root.google.cloud.tasks.v2.DeleteQueueRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteQueue" }); - - /** - * Calls DeleteQueue. - * @function deleteQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IDeleteQueueRequest} request DeleteQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|purgeQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef PurgeQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Queue} [response] Queue - */ - - /** - * Calls PurgeQueue. - * @function purgeQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IPurgeQueueRequest} request PurgeQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.PurgeQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.purgeQueue = function purgeQueue(request, callback) { - return this.rpcCall(purgeQueue, $root.google.cloud.tasks.v2.PurgeQueueRequest, $root.google.cloud.tasks.v2.Queue, request, callback); - }, "name", { value: "PurgeQueue" }); - - /** - * Calls PurgeQueue. - * @function purgeQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IPurgeQueueRequest} request PurgeQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|pauseQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef PauseQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Queue} [response] Queue - */ - - /** - * Calls PauseQueue. - * @function pauseQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IPauseQueueRequest} request PauseQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.PauseQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.pauseQueue = function pauseQueue(request, callback) { - return this.rpcCall(pauseQueue, $root.google.cloud.tasks.v2.PauseQueueRequest, $root.google.cloud.tasks.v2.Queue, request, callback); - }, "name", { value: "PauseQueue" }); - - /** - * Calls PauseQueue. - * @function pauseQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IPauseQueueRequest} request PauseQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|resumeQueue}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef ResumeQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Queue} [response] Queue - */ - - /** - * Calls ResumeQueue. - * @function resumeQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IResumeQueueRequest} request ResumeQueueRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.ResumeQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.resumeQueue = function resumeQueue(request, callback) { - return this.rpcCall(resumeQueue, $root.google.cloud.tasks.v2.ResumeQueueRequest, $root.google.cloud.tasks.v2.Queue, request, callback); - }, "name", { value: "ResumeQueue" }); - - /** - * Calls ResumeQueue. - * @function resumeQueue - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IResumeQueueRequest} request ResumeQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|getIamPolicy}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|setIamPolicy}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|testIamPermissions}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|listTasks}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.tasks.v2.ListTasksRequest, $root.google.cloud.tasks.v2.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|getTask}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.tasks.v2.GetTaskRequest, $root.google.cloud.tasks.v2.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|createTask}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef CreateTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Task} [response] Task - */ - - /** - * Calls CreateTask. - * @function createTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.ICreateTaskRequest} request CreateTaskRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.CreateTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.createTask = function createTask(request, callback) { - return this.rpcCall(createTask, $root.google.cloud.tasks.v2.CreateTaskRequest, $root.google.cloud.tasks.v2.Task, request, callback); - }, "name", { value: "CreateTask" }); - - /** - * Calls CreateTask. - * @function createTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.ICreateTaskRequest} request CreateTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|deleteTask}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef DeleteTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteTask. - * @function deleteTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IDeleteTaskRequest} request DeleteTaskRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.DeleteTaskCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.deleteTask = function deleteTask(request, callback) { - return this.rpcCall(deleteTask, $root.google.cloud.tasks.v2.DeleteTaskRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTask" }); - - /** - * Calls DeleteTask. - * @function deleteTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IDeleteTaskRequest} request DeleteTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2.CloudTasks|runTask}. - * @memberof google.cloud.tasks.v2.CloudTasks - * @typedef RunTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2.Task} [response] Task - */ - - /** - * Calls RunTask. - * @function runTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IRunTaskRequest} request RunTaskRequest message or plain object - * @param {google.cloud.tasks.v2.CloudTasks.RunTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.runTask = function runTask(request, callback) { - return this.rpcCall(runTask, $root.google.cloud.tasks.v2.RunTaskRequest, $root.google.cloud.tasks.v2.Task, request, callback); - }, "name", { value: "RunTask" }); - - /** - * Calls RunTask. - * @function runTask - * @memberof google.cloud.tasks.v2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2.IRunTaskRequest} request RunTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CloudTasks; - })(); - - v2.ListQueuesRequest = (function() { - - /** - * Properties of a ListQueuesRequest. - * @memberof google.cloud.tasks.v2 - * @interface IListQueuesRequest - * @property {string|null} [parent] ListQueuesRequest parent - * @property {string|null} [filter] ListQueuesRequest filter - * @property {number|null} [pageSize] ListQueuesRequest pageSize - * @property {string|null} [pageToken] ListQueuesRequest pageToken - */ - - /** - * Constructs a new ListQueuesRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a ListQueuesRequest. - * @implements IListQueuesRequest - * @constructor - * @param {google.cloud.tasks.v2.IListQueuesRequest=} [properties] Properties to set - */ - function ListQueuesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListQueuesRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.parent = ""; - - /** - * ListQueuesRequest filter. - * @member {string} filter - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.filter = ""; - - /** - * ListQueuesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.pageSize = 0; - - /** - * ListQueuesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListQueuesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2.IListQueuesRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.ListQueuesRequest} ListQueuesRequest instance - */ - ListQueuesRequest.create = function create(properties) { - return new ListQueuesRequest(properties); - }; - - /** - * Encodes the specified ListQueuesRequest message. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2.IListQueuesRequest} message ListQueuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListQueuesRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2.IListQueuesRequest} message ListQueuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.ListQueuesRequest} ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.ListQueuesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.ListQueuesRequest} ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListQueuesRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListQueuesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListQueuesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.ListQueuesRequest} ListQueuesRequest - */ - ListQueuesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.ListQueuesRequest) - return object; - var message = new $root.google.cloud.tasks.v2.ListQueuesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListQueuesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2.ListQueuesRequest} message ListQueuesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListQueuesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListQueuesRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @instance - * @returns {Object.} JSON object - */ - ListQueuesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListQueuesRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.ListQueuesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListQueuesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.ListQueuesRequest"; - }; - - return ListQueuesRequest; - })(); - - v2.ListQueuesResponse = (function() { - - /** - * Properties of a ListQueuesResponse. - * @memberof google.cloud.tasks.v2 - * @interface IListQueuesResponse - * @property {Array.|null} [queues] ListQueuesResponse queues - * @property {string|null} [nextPageToken] ListQueuesResponse nextPageToken - */ - - /** - * Constructs a new ListQueuesResponse. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a ListQueuesResponse. - * @implements IListQueuesResponse - * @constructor - * @param {google.cloud.tasks.v2.IListQueuesResponse=} [properties] Properties to set - */ - function ListQueuesResponse(properties) { - this.queues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListQueuesResponse queues. - * @member {Array.} queues - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @instance - */ - ListQueuesResponse.prototype.queues = $util.emptyArray; - - /** - * ListQueuesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @instance - */ - ListQueuesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListQueuesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2.IListQueuesResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.ListQueuesResponse} ListQueuesResponse instance - */ - ListQueuesResponse.create = function create(properties) { - return new ListQueuesResponse(properties); - }; - - /** - * Encodes the specified ListQueuesResponse message. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2.IListQueuesResponse} message ListQueuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queues != null && message.queues.length) - for (var i = 0; i < message.queues.length; ++i) - $root.google.cloud.tasks.v2.Queue.encode(message.queues[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 ListQueuesResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListQueuesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2.IListQueuesResponse} message ListQueuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.ListQueuesResponse} ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.ListQueuesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.queues && message.queues.length)) - message.queues = []; - message.queues.push($root.google.cloud.tasks.v2.Queue.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.ListQueuesResponse} ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListQueuesResponse message. - * @function verify - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListQueuesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queues != null && message.hasOwnProperty("queues")) { - if (!Array.isArray(message.queues)) - return "queues: array expected"; - for (var i = 0; i < message.queues.length; ++i) { - var error = $root.google.cloud.tasks.v2.Queue.verify(message.queues[i]); - if (error) - return "queues." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListQueuesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.ListQueuesResponse} ListQueuesResponse - */ - ListQueuesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.ListQueuesResponse) - return object; - var message = new $root.google.cloud.tasks.v2.ListQueuesResponse(); - if (object.queues) { - if (!Array.isArray(object.queues)) - throw TypeError(".google.cloud.tasks.v2.ListQueuesResponse.queues: array expected"); - message.queues = []; - for (var i = 0; i < object.queues.length; ++i) { - if (typeof object.queues[i] !== "object") - throw TypeError(".google.cloud.tasks.v2.ListQueuesResponse.queues: object expected"); - message.queues[i] = $root.google.cloud.tasks.v2.Queue.fromObject(object.queues[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListQueuesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2.ListQueuesResponse} message ListQueuesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListQueuesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queues = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.queues && message.queues.length) { - object.queues = []; - for (var j = 0; j < message.queues.length; ++j) - object.queues[j] = $root.google.cloud.tasks.v2.Queue.toObject(message.queues[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListQueuesResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @instance - * @returns {Object.} JSON object - */ - ListQueuesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListQueuesResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.ListQueuesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListQueuesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.ListQueuesResponse"; - }; - - return ListQueuesResponse; - })(); - - v2.GetQueueRequest = (function() { - - /** - * Properties of a GetQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface IGetQueueRequest - * @property {string|null} [name] GetQueueRequest name - */ - - /** - * Constructs a new GetQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a GetQueueRequest. - * @implements IGetQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.IGetQueueRequest=} [properties] Properties to set - */ - function GetQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @instance - */ - GetQueueRequest.prototype.name = ""; - - /** - * Creates a new GetQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2.IGetQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.GetQueueRequest} GetQueueRequest instance - */ - GetQueueRequest.create = function create(properties) { - return new GetQueueRequest(properties); - }; - - /** - * Encodes the specified GetQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.GetQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2.IGetQueueRequest} message GetQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetQueueRequest.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 GetQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.GetQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2.IGetQueueRequest} message GetQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.GetQueueRequest} GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.GetQueueRequest(); - 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 GetQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.GetQueueRequest} GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetQueueRequest.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 GetQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.GetQueueRequest} GetQueueRequest - */ - GetQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.GetQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.GetQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2.GetQueueRequest} message GetQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetQueueRequest.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 GetQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @instance - * @returns {Object.} JSON object - */ - GetQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.GetQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.GetQueueRequest"; - }; - - return GetQueueRequest; - })(); - - v2.CreateQueueRequest = (function() { - - /** - * Properties of a CreateQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface ICreateQueueRequest - * @property {string|null} [parent] CreateQueueRequest parent - * @property {google.cloud.tasks.v2.IQueue|null} [queue] CreateQueueRequest queue - */ - - /** - * Constructs a new CreateQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a CreateQueueRequest. - * @implements ICreateQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.ICreateQueueRequest=} [properties] Properties to set - */ - function CreateQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateQueueRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @instance - */ - CreateQueueRequest.prototype.parent = ""; - - /** - * CreateQueueRequest queue. - * @member {google.cloud.tasks.v2.IQueue|null|undefined} queue - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @instance - */ - CreateQueueRequest.prototype.queue = null; - - /** - * Creates a new CreateQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2.ICreateQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.CreateQueueRequest} CreateQueueRequest instance - */ - CreateQueueRequest.create = function create(properties) { - return new CreateQueueRequest(properties); - }; - - /** - * Encodes the specified CreateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.CreateQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2.ICreateQueueRequest} message CreateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateQueueRequest.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.queue != null && Object.hasOwnProperty.call(message, "queue")) - $root.google.cloud.tasks.v2.Queue.encode(message.queue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.CreateQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2.ICreateQueueRequest} message CreateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.CreateQueueRequest} CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.CreateQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.queue = $root.google.cloud.tasks.v2.Queue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.CreateQueueRequest} CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateQueueRequest.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.queue != null && message.hasOwnProperty("queue")) { - var error = $root.google.cloud.tasks.v2.Queue.verify(message.queue); - if (error) - return "queue." + error; - } - return null; - }; - - /** - * Creates a CreateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.CreateQueueRequest} CreateQueueRequest - */ - CreateQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.CreateQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.CreateQueueRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.queue != null) { - if (typeof object.queue !== "object") - throw TypeError(".google.cloud.tasks.v2.CreateQueueRequest.queue: object expected"); - message.queue = $root.google.cloud.tasks.v2.Queue.fromObject(object.queue); - } - return message; - }; - - /** - * Creates a plain object from a CreateQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2.CreateQueueRequest} message CreateQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.queue = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = $root.google.cloud.tasks.v2.Queue.toObject(message.queue, options); - return object; - }; - - /** - * Converts this CreateQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @instance - * @returns {Object.} JSON object - */ - CreateQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.CreateQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.CreateQueueRequest"; - }; - - return CreateQueueRequest; - })(); - - v2.UpdateQueueRequest = (function() { - - /** - * Properties of an UpdateQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface IUpdateQueueRequest - * @property {google.cloud.tasks.v2.IQueue|null} [queue] UpdateQueueRequest queue - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateQueueRequest updateMask - */ - - /** - * Constructs a new UpdateQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents an UpdateQueueRequest. - * @implements IUpdateQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.IUpdateQueueRequest=} [properties] Properties to set - */ - function UpdateQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateQueueRequest queue. - * @member {google.cloud.tasks.v2.IQueue|null|undefined} queue - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @instance - */ - UpdateQueueRequest.prototype.queue = null; - - /** - * UpdateQueueRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @instance - */ - UpdateQueueRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2.IUpdateQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.UpdateQueueRequest} UpdateQueueRequest instance - */ - UpdateQueueRequest.create = function create(properties) { - return new UpdateQueueRequest(properties); - }; - - /** - * Encodes the specified UpdateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.UpdateQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2.IUpdateQueueRequest} message UpdateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateQueueRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - $root.google.cloud.tasks.v2.Queue.encode(message.queue, 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 UpdateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.UpdateQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2.IUpdateQueueRequest} message UpdateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.UpdateQueueRequest} UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.UpdateQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.queue = $root.google.cloud.tasks.v2.Queue.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 UpdateQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.UpdateQueueRequest} UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateQueueRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) { - var error = $root.google.cloud.tasks.v2.Queue.verify(message.queue); - if (error) - return "queue." + 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 UpdateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.UpdateQueueRequest} UpdateQueueRequest - */ - UpdateQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.UpdateQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.UpdateQueueRequest(); - if (object.queue != null) { - if (typeof object.queue !== "object") - throw TypeError(".google.cloud.tasks.v2.UpdateQueueRequest.queue: object expected"); - message.queue = $root.google.cloud.tasks.v2.Queue.fromObject(object.queue); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.tasks.v2.UpdateQueueRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2.UpdateQueueRequest} message UpdateQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = null; - object.updateMask = null; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = $root.google.cloud.tasks.v2.Queue.toObject(message.queue, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.UpdateQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.UpdateQueueRequest"; - }; - - return UpdateQueueRequest; - })(); - - v2.DeleteQueueRequest = (function() { - - /** - * Properties of a DeleteQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface IDeleteQueueRequest - * @property {string|null} [name] DeleteQueueRequest name - */ - - /** - * Constructs a new DeleteQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a DeleteQueueRequest. - * @implements IDeleteQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.IDeleteQueueRequest=} [properties] Properties to set - */ - function DeleteQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @instance - */ - DeleteQueueRequest.prototype.name = ""; - - /** - * Creates a new DeleteQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2.IDeleteQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.DeleteQueueRequest} DeleteQueueRequest instance - */ - DeleteQueueRequest.create = function create(properties) { - return new DeleteQueueRequest(properties); - }; - - /** - * Encodes the specified DeleteQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.DeleteQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2.IDeleteQueueRequest} message DeleteQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteQueueRequest.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 DeleteQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.DeleteQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2.IDeleteQueueRequest} message DeleteQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.DeleteQueueRequest} DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.DeleteQueueRequest(); - 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 DeleteQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.DeleteQueueRequest} DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteQueueRequest.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 DeleteQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.DeleteQueueRequest} DeleteQueueRequest - */ - DeleteQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.DeleteQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.DeleteQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2.DeleteQueueRequest} message DeleteQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteQueueRequest.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 DeleteQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.DeleteQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.DeleteQueueRequest"; - }; - - return DeleteQueueRequest; - })(); - - v2.PurgeQueueRequest = (function() { - - /** - * Properties of a PurgeQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface IPurgeQueueRequest - * @property {string|null} [name] PurgeQueueRequest name - */ - - /** - * Constructs a new PurgeQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a PurgeQueueRequest. - * @implements IPurgeQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.IPurgeQueueRequest=} [properties] Properties to set - */ - function PurgeQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PurgeQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @instance - */ - PurgeQueueRequest.prototype.name = ""; - - /** - * Creates a new PurgeQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2.IPurgeQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.PurgeQueueRequest} PurgeQueueRequest instance - */ - PurgeQueueRequest.create = function create(properties) { - return new PurgeQueueRequest(properties); - }; - - /** - * Encodes the specified PurgeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.PurgeQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2.IPurgeQueueRequest} message PurgeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeQueueRequest.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 PurgeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.PurgeQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2.IPurgeQueueRequest} message PurgeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.PurgeQueueRequest} PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.PurgeQueueRequest(); - 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 PurgeQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.PurgeQueueRequest} PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PurgeQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurgeQueueRequest.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 PurgeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.PurgeQueueRequest} PurgeQueueRequest - */ - PurgeQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.PurgeQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.PurgeQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PurgeQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2.PurgeQueueRequest} message PurgeQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurgeQueueRequest.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 PurgeQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @instance - * @returns {Object.} JSON object - */ - PurgeQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PurgeQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.PurgeQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PurgeQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.PurgeQueueRequest"; - }; - - return PurgeQueueRequest; - })(); - - v2.PauseQueueRequest = (function() { - - /** - * Properties of a PauseQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface IPauseQueueRequest - * @property {string|null} [name] PauseQueueRequest name - */ - - /** - * Constructs a new PauseQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a PauseQueueRequest. - * @implements IPauseQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.IPauseQueueRequest=} [properties] Properties to set - */ - function PauseQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PauseQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @instance - */ - PauseQueueRequest.prototype.name = ""; - - /** - * Creates a new PauseQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2.IPauseQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.PauseQueueRequest} PauseQueueRequest instance - */ - PauseQueueRequest.create = function create(properties) { - return new PauseQueueRequest(properties); - }; - - /** - * Encodes the specified PauseQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.PauseQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2.IPauseQueueRequest} message PauseQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PauseQueueRequest.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 PauseQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.PauseQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2.IPauseQueueRequest} message PauseQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PauseQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.PauseQueueRequest} PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PauseQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.PauseQueueRequest(); - 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 PauseQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.PauseQueueRequest} PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PauseQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PauseQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PauseQueueRequest.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 PauseQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.PauseQueueRequest} PauseQueueRequest - */ - PauseQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.PauseQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.PauseQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PauseQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2.PauseQueueRequest} message PauseQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PauseQueueRequest.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 PauseQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @instance - * @returns {Object.} JSON object - */ - PauseQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PauseQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.PauseQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PauseQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.PauseQueueRequest"; - }; - - return PauseQueueRequest; - })(); - - v2.ResumeQueueRequest = (function() { - - /** - * Properties of a ResumeQueueRequest. - * @memberof google.cloud.tasks.v2 - * @interface IResumeQueueRequest - * @property {string|null} [name] ResumeQueueRequest name - */ - - /** - * Constructs a new ResumeQueueRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a ResumeQueueRequest. - * @implements IResumeQueueRequest - * @constructor - * @param {google.cloud.tasks.v2.IResumeQueueRequest=} [properties] Properties to set - */ - function ResumeQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResumeQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @instance - */ - ResumeQueueRequest.prototype.name = ""; - - /** - * Creates a new ResumeQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2.IResumeQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.ResumeQueueRequest} ResumeQueueRequest instance - */ - ResumeQueueRequest.create = function create(properties) { - return new ResumeQueueRequest(properties); - }; - - /** - * Encodes the specified ResumeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2.ResumeQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2.IResumeQueueRequest} message ResumeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResumeQueueRequest.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 ResumeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ResumeQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2.IResumeQueueRequest} message ResumeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResumeQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.ResumeQueueRequest} ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResumeQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.ResumeQueueRequest(); - 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 ResumeQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.ResumeQueueRequest} ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResumeQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResumeQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResumeQueueRequest.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 ResumeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.ResumeQueueRequest} ResumeQueueRequest - */ - ResumeQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.ResumeQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2.ResumeQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a ResumeQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2.ResumeQueueRequest} message ResumeQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResumeQueueRequest.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 ResumeQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @instance - * @returns {Object.} JSON object - */ - ResumeQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResumeQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.ResumeQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResumeQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.ResumeQueueRequest"; - }; - - return ResumeQueueRequest; - })(); - - v2.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.tasks.v2 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {google.cloud.tasks.v2.Task.View|null} [responseView] ListTasksRequest responseView - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.tasks.v2.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest responseView. - * @member {google.cloud.tasks.v2.Task.View} responseView - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.responseView = 0; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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 ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.ListTasksRequest) - return object; - var message = new $root.google.cloud.tasks.v2.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - 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 ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2.Task.View[message.responseView] : message.responseView; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v2.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.tasks.v2 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.tasks.v2.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.tasks.v2.Task.encode(message.tasks[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 ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.tasks.v2.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.tasks.v2.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.ListTasksResponse) - return object; - var message = new $root.google.cloud.tasks.v2.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.tasks.v2.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.tasks.v2.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.tasks.v2.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tasks = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.tasks.v2.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v2.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.tasks.v2 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - * @property {google.cloud.tasks.v2.Task.View|null} [responseView] GetTaskRequest responseView - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.tasks.v2.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * GetTaskRequest responseView. - * @member {google.cloud.tasks.v2.Task.View} responseView - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.responseView = 0; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.GetTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v2.CreateTaskRequest = (function() { - - /** - * Properties of a CreateTaskRequest. - * @memberof google.cloud.tasks.v2 - * @interface ICreateTaskRequest - * @property {string|null} [parent] CreateTaskRequest parent - * @property {google.cloud.tasks.v2.ITask|null} [task] CreateTaskRequest task - * @property {google.cloud.tasks.v2.Task.View|null} [responseView] CreateTaskRequest responseView - */ - - /** - * Constructs a new CreateTaskRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a CreateTaskRequest. - * @implements ICreateTaskRequest - * @constructor - * @param {google.cloud.tasks.v2.ICreateTaskRequest=} [properties] Properties to set - */ - function CreateTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateTaskRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.parent = ""; - - /** - * CreateTaskRequest task. - * @member {google.cloud.tasks.v2.ITask|null|undefined} task - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.task = null; - - /** - * CreateTaskRequest responseView. - * @member {google.cloud.tasks.v2.Task.View} responseView - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.responseView = 0; - - /** - * Creates a new CreateTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2.ICreateTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.CreateTaskRequest} CreateTaskRequest instance - */ - CreateTaskRequest.create = function create(properties) { - return new CreateTaskRequest(properties); - }; - - /** - * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.CreateTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateTaskRequest.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.task != null && Object.hasOwnProperty.call(message, "task")) - $root.google.cloud.tasks.v2.Task.encode(message.task, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.CreateTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.CreateTaskRequest} CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.CreateTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.task = $root.google.cloud.tasks.v2.Task.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.CreateTaskRequest} CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateTaskRequest.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.task != null && message.hasOwnProperty("task")) { - var error = $root.google.cloud.tasks.v2.Task.verify(message.task); - if (error) - return "task." + error; - } - if (message.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.CreateTaskRequest} CreateTaskRequest - */ - CreateTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.CreateTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2.CreateTaskRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.task != null) { - if (typeof object.task !== "object") - throw TypeError(".google.cloud.tasks.v2.CreateTaskRequest.task: object expected"); - message.task = $root.google.cloud.tasks.v2.Task.fromObject(object.task); - } - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2.CreateTaskRequest} message CreateTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.task = null; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.task != null && message.hasOwnProperty("task")) - object.task = $root.google.cloud.tasks.v2.Task.toObject(message.task, options); - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this CreateTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @instance - * @returns {Object.} JSON object - */ - CreateTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.CreateTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.CreateTaskRequest"; - }; - - return CreateTaskRequest; - })(); - - v2.DeleteTaskRequest = (function() { - - /** - * Properties of a DeleteTaskRequest. - * @memberof google.cloud.tasks.v2 - * @interface IDeleteTaskRequest - * @property {string|null} [name] DeleteTaskRequest name - */ - - /** - * Constructs a new DeleteTaskRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a DeleteTaskRequest. - * @implements IDeleteTaskRequest - * @constructor - * @param {google.cloud.tasks.v2.IDeleteTaskRequest=} [properties] Properties to set - */ - function DeleteTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @instance - */ - DeleteTaskRequest.prototype.name = ""; - - /** - * Creates a new DeleteTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2.IDeleteTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.DeleteTaskRequest} DeleteTaskRequest instance - */ - DeleteTaskRequest.create = function create(properties) { - return new DeleteTaskRequest(properties); - }; - - /** - * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.DeleteTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTaskRequest.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 DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.DeleteTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.DeleteTaskRequest} DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.DeleteTaskRequest(); - 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 DeleteTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.DeleteTaskRequest} DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteTaskRequest.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 DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.DeleteTaskRequest} DeleteTaskRequest - */ - DeleteTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.DeleteTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2.DeleteTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2.DeleteTaskRequest} message DeleteTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteTaskRequest.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 DeleteTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.DeleteTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.DeleteTaskRequest"; - }; - - return DeleteTaskRequest; - })(); - - v2.RunTaskRequest = (function() { - - /** - * Properties of a RunTaskRequest. - * @memberof google.cloud.tasks.v2 - * @interface IRunTaskRequest - * @property {string|null} [name] RunTaskRequest name - * @property {google.cloud.tasks.v2.Task.View|null} [responseView] RunTaskRequest responseView - */ - - /** - * Constructs a new RunTaskRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a RunTaskRequest. - * @implements IRunTaskRequest - * @constructor - * @param {google.cloud.tasks.v2.IRunTaskRequest=} [properties] Properties to set - */ - function RunTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @instance - */ - RunTaskRequest.prototype.name = ""; - - /** - * RunTaskRequest responseView. - * @member {google.cloud.tasks.v2.Task.View} responseView - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @instance - */ - RunTaskRequest.prototype.responseView = 0; - - /** - * Creates a new RunTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2.IRunTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.RunTaskRequest} RunTaskRequest instance - */ - RunTaskRequest.create = function create(properties) { - return new RunTaskRequest(properties); - }; - - /** - * Encodes the specified RunTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2.RunTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2.IRunTaskRequest} message RunTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunTaskRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified RunTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.RunTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2.IRunTaskRequest} message RunTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.RunTaskRequest} RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.RunTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.RunTaskRequest} RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunTaskRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a RunTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.RunTaskRequest} RunTaskRequest - */ - RunTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.RunTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2.RunTaskRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a RunTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2.RunTaskRequest} message RunTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this RunTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @instance - * @returns {Object.} JSON object - */ - RunTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.RunTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.RunTaskRequest"; - }; - - return RunTaskRequest; - })(); - - v2.Queue = (function() { - - /** - * Properties of a Queue. - * @memberof google.cloud.tasks.v2 - * @interface IQueue - * @property {string|null} [name] Queue name - * @property {google.cloud.tasks.v2.IAppEngineRouting|null} [appEngineRoutingOverride] Queue appEngineRoutingOverride - * @property {google.cloud.tasks.v2.IRateLimits|null} [rateLimits] Queue rateLimits - * @property {google.cloud.tasks.v2.IRetryConfig|null} [retryConfig] Queue retryConfig - * @property {google.cloud.tasks.v2.Queue.State|null} [state] Queue state - * @property {google.protobuf.ITimestamp|null} [purgeTime] Queue purgeTime - * @property {google.cloud.tasks.v2.IStackdriverLoggingConfig|null} [stackdriverLoggingConfig] Queue stackdriverLoggingConfig - */ - - /** - * Constructs a new Queue. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a Queue. - * @implements IQueue - * @constructor - * @param {google.cloud.tasks.v2.IQueue=} [properties] Properties to set - */ - function Queue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Queue name. - * @member {string} name - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.name = ""; - - /** - * Queue appEngineRoutingOverride. - * @member {google.cloud.tasks.v2.IAppEngineRouting|null|undefined} appEngineRoutingOverride - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.appEngineRoutingOverride = null; - - /** - * Queue rateLimits. - * @member {google.cloud.tasks.v2.IRateLimits|null|undefined} rateLimits - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.rateLimits = null; - - /** - * Queue retryConfig. - * @member {google.cloud.tasks.v2.IRetryConfig|null|undefined} retryConfig - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.retryConfig = null; - - /** - * Queue state. - * @member {google.cloud.tasks.v2.Queue.State} state - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.state = 0; - - /** - * Queue purgeTime. - * @member {google.protobuf.ITimestamp|null|undefined} purgeTime - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.purgeTime = null; - - /** - * Queue stackdriverLoggingConfig. - * @member {google.cloud.tasks.v2.IStackdriverLoggingConfig|null|undefined} stackdriverLoggingConfig - * @memberof google.cloud.tasks.v2.Queue - * @instance - */ - Queue.prototype.stackdriverLoggingConfig = null; - - /** - * Creates a new Queue instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {google.cloud.tasks.v2.IQueue=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.Queue} Queue instance - */ - Queue.create = function create(properties) { - return new Queue(properties); - }; - - /** - * Encodes the specified Queue message. Does not implicitly {@link google.cloud.tasks.v2.Queue.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {google.cloud.tasks.v2.IQueue} message Queue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Queue.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.appEngineRoutingOverride != null && Object.hasOwnProperty.call(message, "appEngineRoutingOverride")) - $root.google.cloud.tasks.v2.AppEngineRouting.encode(message.appEngineRoutingOverride, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.rateLimits != null && Object.hasOwnProperty.call(message, "rateLimits")) - $root.google.cloud.tasks.v2.RateLimits.encode(message.rateLimits, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.retryConfig != null && Object.hasOwnProperty.call(message, "retryConfig")) - $root.google.cloud.tasks.v2.RetryConfig.encode(message.retryConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.purgeTime != null && Object.hasOwnProperty.call(message, "purgeTime")) - $root.google.protobuf.Timestamp.encode(message.purgeTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.stackdriverLoggingConfig != null && Object.hasOwnProperty.call(message, "stackdriverLoggingConfig")) - $root.google.cloud.tasks.v2.StackdriverLoggingConfig.encode(message.stackdriverLoggingConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Queue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.Queue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {google.cloud.tasks.v2.IQueue} message Queue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Queue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Queue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.Queue} Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Queue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.Queue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.appEngineRoutingOverride = $root.google.cloud.tasks.v2.AppEngineRouting.decode(reader, reader.uint32()); - break; - } - case 3: { - message.rateLimits = $root.google.cloud.tasks.v2.RateLimits.decode(reader, reader.uint32()); - break; - } - case 4: { - message.retryConfig = $root.google.cloud.tasks.v2.RetryConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.state = reader.int32(); - break; - } - case 6: { - message.purgeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.stackdriverLoggingConfig = $root.google.cloud.tasks.v2.StackdriverLoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Queue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.Queue} Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Queue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Queue message. - * @function verify - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Queue.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.appEngineRoutingOverride != null && message.hasOwnProperty("appEngineRoutingOverride")) { - var error = $root.google.cloud.tasks.v2.AppEngineRouting.verify(message.appEngineRoutingOverride); - if (error) - return "appEngineRoutingOverride." + error; - } - if (message.rateLimits != null && message.hasOwnProperty("rateLimits")) { - var error = $root.google.cloud.tasks.v2.RateLimits.verify(message.rateLimits); - if (error) - return "rateLimits." + error; - } - if (message.retryConfig != null && message.hasOwnProperty("retryConfig")) { - var error = $root.google.cloud.tasks.v2.RetryConfig.verify(message.retryConfig); - if (error) - return "retryConfig." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.purgeTime != null && message.hasOwnProperty("purgeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.purgeTime); - if (error) - return "purgeTime." + error; - } - if (message.stackdriverLoggingConfig != null && message.hasOwnProperty("stackdriverLoggingConfig")) { - var error = $root.google.cloud.tasks.v2.StackdriverLoggingConfig.verify(message.stackdriverLoggingConfig); - if (error) - return "stackdriverLoggingConfig." + error; - } - return null; - }; - - /** - * Creates a Queue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.Queue} Queue - */ - Queue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.Queue) - return object; - var message = new $root.google.cloud.tasks.v2.Queue(); - if (object.name != null) - message.name = String(object.name); - if (object.appEngineRoutingOverride != null) { - if (typeof object.appEngineRoutingOverride !== "object") - throw TypeError(".google.cloud.tasks.v2.Queue.appEngineRoutingOverride: object expected"); - message.appEngineRoutingOverride = $root.google.cloud.tasks.v2.AppEngineRouting.fromObject(object.appEngineRoutingOverride); - } - if (object.rateLimits != null) { - if (typeof object.rateLimits !== "object") - throw TypeError(".google.cloud.tasks.v2.Queue.rateLimits: object expected"); - message.rateLimits = $root.google.cloud.tasks.v2.RateLimits.fromObject(object.rateLimits); - } - if (object.retryConfig != null) { - if (typeof object.retryConfig !== "object") - throw TypeError(".google.cloud.tasks.v2.Queue.retryConfig: object expected"); - message.retryConfig = $root.google.cloud.tasks.v2.RetryConfig.fromObject(object.retryConfig); - } - 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 "RUNNING": - case 1: - message.state = 1; - break; - case "PAUSED": - case 2: - message.state = 2; - break; - case "DISABLED": - case 3: - message.state = 3; - break; - } - if (object.purgeTime != null) { - if (typeof object.purgeTime !== "object") - throw TypeError(".google.cloud.tasks.v2.Queue.purgeTime: object expected"); - message.purgeTime = $root.google.protobuf.Timestamp.fromObject(object.purgeTime); - } - if (object.stackdriverLoggingConfig != null) { - if (typeof object.stackdriverLoggingConfig !== "object") - throw TypeError(".google.cloud.tasks.v2.Queue.stackdriverLoggingConfig: object expected"); - message.stackdriverLoggingConfig = $root.google.cloud.tasks.v2.StackdriverLoggingConfig.fromObject(object.stackdriverLoggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a Queue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {google.cloud.tasks.v2.Queue} message Queue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Queue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.appEngineRoutingOverride = null; - object.rateLimits = null; - object.retryConfig = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.purgeTime = null; - object.stackdriverLoggingConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appEngineRoutingOverride != null && message.hasOwnProperty("appEngineRoutingOverride")) - object.appEngineRoutingOverride = $root.google.cloud.tasks.v2.AppEngineRouting.toObject(message.appEngineRoutingOverride, options); - if (message.rateLimits != null && message.hasOwnProperty("rateLimits")) - object.rateLimits = $root.google.cloud.tasks.v2.RateLimits.toObject(message.rateLimits, options); - if (message.retryConfig != null && message.hasOwnProperty("retryConfig")) - object.retryConfig = $root.google.cloud.tasks.v2.RetryConfig.toObject(message.retryConfig, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.tasks.v2.Queue.State[message.state] === undefined ? message.state : $root.google.cloud.tasks.v2.Queue.State[message.state] : message.state; - if (message.purgeTime != null && message.hasOwnProperty("purgeTime")) - object.purgeTime = $root.google.protobuf.Timestamp.toObject(message.purgeTime, options); - if (message.stackdriverLoggingConfig != null && message.hasOwnProperty("stackdriverLoggingConfig")) - object.stackdriverLoggingConfig = $root.google.cloud.tasks.v2.StackdriverLoggingConfig.toObject(message.stackdriverLoggingConfig, options); - return object; - }; - - /** - * Converts this Queue to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.Queue - * @instance - * @returns {Object.} JSON object - */ - Queue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Queue - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.Queue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Queue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.Queue"; - }; - - /** - * State enum. - * @name google.cloud.tasks.v2.Queue.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} PAUSED=2 PAUSED value - * @property {number} DISABLED=3 DISABLED value - */ - Queue.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "DISABLED"] = 3; - return values; - })(); - - return Queue; - })(); - - v2.RateLimits = (function() { - - /** - * Properties of a RateLimits. - * @memberof google.cloud.tasks.v2 - * @interface IRateLimits - * @property {number|null} [maxDispatchesPerSecond] RateLimits maxDispatchesPerSecond - * @property {number|null} [maxBurstSize] RateLimits maxBurstSize - * @property {number|null} [maxConcurrentDispatches] RateLimits maxConcurrentDispatches - */ - - /** - * Constructs a new RateLimits. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a RateLimits. - * @implements IRateLimits - * @constructor - * @param {google.cloud.tasks.v2.IRateLimits=} [properties] Properties to set - */ - function RateLimits(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RateLimits maxDispatchesPerSecond. - * @member {number} maxDispatchesPerSecond - * @memberof google.cloud.tasks.v2.RateLimits - * @instance - */ - RateLimits.prototype.maxDispatchesPerSecond = 0; - - /** - * RateLimits maxBurstSize. - * @member {number} maxBurstSize - * @memberof google.cloud.tasks.v2.RateLimits - * @instance - */ - RateLimits.prototype.maxBurstSize = 0; - - /** - * RateLimits maxConcurrentDispatches. - * @member {number} maxConcurrentDispatches - * @memberof google.cloud.tasks.v2.RateLimits - * @instance - */ - RateLimits.prototype.maxConcurrentDispatches = 0; - - /** - * Creates a new RateLimits instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {google.cloud.tasks.v2.IRateLimits=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.RateLimits} RateLimits instance - */ - RateLimits.create = function create(properties) { - return new RateLimits(properties); - }; - - /** - * Encodes the specified RateLimits message. Does not implicitly {@link google.cloud.tasks.v2.RateLimits.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {google.cloud.tasks.v2.IRateLimits} message RateLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateLimits.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxDispatchesPerSecond != null && Object.hasOwnProperty.call(message, "maxDispatchesPerSecond")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.maxDispatchesPerSecond); - if (message.maxBurstSize != null && Object.hasOwnProperty.call(message, "maxBurstSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxBurstSize); - if (message.maxConcurrentDispatches != null && Object.hasOwnProperty.call(message, "maxConcurrentDispatches")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxConcurrentDispatches); - return writer; - }; - - /** - * Encodes the specified RateLimits message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.RateLimits.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {google.cloud.tasks.v2.IRateLimits} message RateLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateLimits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RateLimits message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.RateLimits} RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateLimits.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.RateLimits(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxDispatchesPerSecond = reader.double(); - break; - } - case 2: { - message.maxBurstSize = reader.int32(); - break; - } - case 3: { - message.maxConcurrentDispatches = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RateLimits message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.RateLimits} RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateLimits.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RateLimits message. - * @function verify - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RateLimits.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxDispatchesPerSecond != null && message.hasOwnProperty("maxDispatchesPerSecond")) - if (typeof message.maxDispatchesPerSecond !== "number") - return "maxDispatchesPerSecond: number expected"; - if (message.maxBurstSize != null && message.hasOwnProperty("maxBurstSize")) - if (!$util.isInteger(message.maxBurstSize)) - return "maxBurstSize: integer expected"; - if (message.maxConcurrentDispatches != null && message.hasOwnProperty("maxConcurrentDispatches")) - if (!$util.isInteger(message.maxConcurrentDispatches)) - return "maxConcurrentDispatches: integer expected"; - return null; - }; - - /** - * Creates a RateLimits message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.RateLimits} RateLimits - */ - RateLimits.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.RateLimits) - return object; - var message = new $root.google.cloud.tasks.v2.RateLimits(); - if (object.maxDispatchesPerSecond != null) - message.maxDispatchesPerSecond = Number(object.maxDispatchesPerSecond); - if (object.maxBurstSize != null) - message.maxBurstSize = object.maxBurstSize | 0; - if (object.maxConcurrentDispatches != null) - message.maxConcurrentDispatches = object.maxConcurrentDispatches | 0; - return message; - }; - - /** - * Creates a plain object from a RateLimits message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {google.cloud.tasks.v2.RateLimits} message RateLimits - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RateLimits.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxDispatchesPerSecond = 0; - object.maxBurstSize = 0; - object.maxConcurrentDispatches = 0; - } - if (message.maxDispatchesPerSecond != null && message.hasOwnProperty("maxDispatchesPerSecond")) - object.maxDispatchesPerSecond = options.json && !isFinite(message.maxDispatchesPerSecond) ? String(message.maxDispatchesPerSecond) : message.maxDispatchesPerSecond; - if (message.maxBurstSize != null && message.hasOwnProperty("maxBurstSize")) - object.maxBurstSize = message.maxBurstSize; - if (message.maxConcurrentDispatches != null && message.hasOwnProperty("maxConcurrentDispatches")) - object.maxConcurrentDispatches = message.maxConcurrentDispatches; - return object; - }; - - /** - * Converts this RateLimits to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.RateLimits - * @instance - * @returns {Object.} JSON object - */ - RateLimits.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RateLimits - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.RateLimits - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RateLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.RateLimits"; - }; - - return RateLimits; - })(); - - v2.RetryConfig = (function() { - - /** - * Properties of a RetryConfig. - * @memberof google.cloud.tasks.v2 - * @interface IRetryConfig - * @property {number|null} [maxAttempts] RetryConfig maxAttempts - * @property {google.protobuf.IDuration|null} [maxRetryDuration] RetryConfig maxRetryDuration - * @property {google.protobuf.IDuration|null} [minBackoff] RetryConfig minBackoff - * @property {google.protobuf.IDuration|null} [maxBackoff] RetryConfig maxBackoff - * @property {number|null} [maxDoublings] RetryConfig maxDoublings - */ - - /** - * Constructs a new RetryConfig. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a RetryConfig. - * @implements IRetryConfig - * @constructor - * @param {google.cloud.tasks.v2.IRetryConfig=} [properties] Properties to set - */ - function RetryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetryConfig maxAttempts. - * @member {number} maxAttempts - * @memberof google.cloud.tasks.v2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxAttempts = 0; - - /** - * RetryConfig maxRetryDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRetryDuration - * @memberof google.cloud.tasks.v2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxRetryDuration = null; - - /** - * RetryConfig minBackoff. - * @member {google.protobuf.IDuration|null|undefined} minBackoff - * @memberof google.cloud.tasks.v2.RetryConfig - * @instance - */ - RetryConfig.prototype.minBackoff = null; - - /** - * RetryConfig maxBackoff. - * @member {google.protobuf.IDuration|null|undefined} maxBackoff - * @memberof google.cloud.tasks.v2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxBackoff = null; - - /** - * RetryConfig maxDoublings. - * @member {number} maxDoublings - * @memberof google.cloud.tasks.v2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxDoublings = 0; - - /** - * Creates a new RetryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {google.cloud.tasks.v2.IRetryConfig=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.RetryConfig} RetryConfig instance - */ - RetryConfig.create = function create(properties) { - return new RetryConfig(properties); - }; - - /** - * Encodes the specified RetryConfig message. Does not implicitly {@link google.cloud.tasks.v2.RetryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {google.cloud.tasks.v2.IRetryConfig} message RetryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxAttempts != null && Object.hasOwnProperty.call(message, "maxAttempts")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxAttempts); - if (message.maxRetryDuration != null && Object.hasOwnProperty.call(message, "maxRetryDuration")) - $root.google.protobuf.Duration.encode(message.maxRetryDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.minBackoff != null && Object.hasOwnProperty.call(message, "minBackoff")) - $root.google.protobuf.Duration.encode(message.minBackoff, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maxBackoff != null && Object.hasOwnProperty.call(message, "maxBackoff")) - $root.google.protobuf.Duration.encode(message.maxBackoff, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxDoublings != null && Object.hasOwnProperty.call(message, "maxDoublings")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxDoublings); - return writer; - }; - - /** - * Encodes the specified RetryConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.RetryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {google.cloud.tasks.v2.IRetryConfig} message RetryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.RetryConfig} RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.RetryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxAttempts = reader.int32(); - break; - } - case 2: { - message.maxRetryDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.minBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.maxBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxDoublings = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.RetryConfig} RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetryConfig message. - * @function verify - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxAttempts != null && message.hasOwnProperty("maxAttempts")) - if (!$util.isInteger(message.maxAttempts)) - return "maxAttempts: integer expected"; - if (message.maxRetryDuration != null && message.hasOwnProperty("maxRetryDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRetryDuration); - if (error) - return "maxRetryDuration." + error; - } - if (message.minBackoff != null && message.hasOwnProperty("minBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.minBackoff); - if (error) - return "minBackoff." + error; - } - if (message.maxBackoff != null && message.hasOwnProperty("maxBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.maxBackoff); - if (error) - return "maxBackoff." + error; - } - if (message.maxDoublings != null && message.hasOwnProperty("maxDoublings")) - if (!$util.isInteger(message.maxDoublings)) - return "maxDoublings: integer expected"; - return null; - }; - - /** - * Creates a RetryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.RetryConfig} RetryConfig - */ - RetryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.RetryConfig) - return object; - var message = new $root.google.cloud.tasks.v2.RetryConfig(); - if (object.maxAttempts != null) - message.maxAttempts = object.maxAttempts | 0; - if (object.maxRetryDuration != null) { - if (typeof object.maxRetryDuration !== "object") - throw TypeError(".google.cloud.tasks.v2.RetryConfig.maxRetryDuration: object expected"); - message.maxRetryDuration = $root.google.protobuf.Duration.fromObject(object.maxRetryDuration); - } - if (object.minBackoff != null) { - if (typeof object.minBackoff !== "object") - throw TypeError(".google.cloud.tasks.v2.RetryConfig.minBackoff: object expected"); - message.minBackoff = $root.google.protobuf.Duration.fromObject(object.minBackoff); - } - if (object.maxBackoff != null) { - if (typeof object.maxBackoff !== "object") - throw TypeError(".google.cloud.tasks.v2.RetryConfig.maxBackoff: object expected"); - message.maxBackoff = $root.google.protobuf.Duration.fromObject(object.maxBackoff); - } - if (object.maxDoublings != null) - message.maxDoublings = object.maxDoublings | 0; - return message; - }; - - /** - * Creates a plain object from a RetryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {google.cloud.tasks.v2.RetryConfig} message RetryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxAttempts = 0; - object.maxRetryDuration = null; - object.minBackoff = null; - object.maxBackoff = null; - object.maxDoublings = 0; - } - if (message.maxAttempts != null && message.hasOwnProperty("maxAttempts")) - object.maxAttempts = message.maxAttempts; - if (message.maxRetryDuration != null && message.hasOwnProperty("maxRetryDuration")) - object.maxRetryDuration = $root.google.protobuf.Duration.toObject(message.maxRetryDuration, options); - if (message.minBackoff != null && message.hasOwnProperty("minBackoff")) - object.minBackoff = $root.google.protobuf.Duration.toObject(message.minBackoff, options); - if (message.maxBackoff != null && message.hasOwnProperty("maxBackoff")) - object.maxBackoff = $root.google.protobuf.Duration.toObject(message.maxBackoff, options); - if (message.maxDoublings != null && message.hasOwnProperty("maxDoublings")) - object.maxDoublings = message.maxDoublings; - return object; - }; - - /** - * Converts this RetryConfig to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.RetryConfig - * @instance - * @returns {Object.} JSON object - */ - RetryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetryConfig - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.RetryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.RetryConfig"; - }; - - return RetryConfig; - })(); - - v2.StackdriverLoggingConfig = (function() { - - /** - * Properties of a StackdriverLoggingConfig. - * @memberof google.cloud.tasks.v2 - * @interface IStackdriverLoggingConfig - * @property {number|null} [samplingRatio] StackdriverLoggingConfig samplingRatio - */ - - /** - * Constructs a new StackdriverLoggingConfig. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a StackdriverLoggingConfig. - * @implements IStackdriverLoggingConfig - * @constructor - * @param {google.cloud.tasks.v2.IStackdriverLoggingConfig=} [properties] Properties to set - */ - function StackdriverLoggingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StackdriverLoggingConfig samplingRatio. - * @member {number} samplingRatio - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @instance - */ - StackdriverLoggingConfig.prototype.samplingRatio = 0; - - /** - * Creates a new StackdriverLoggingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2.IStackdriverLoggingConfig=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.StackdriverLoggingConfig} StackdriverLoggingConfig instance - */ - StackdriverLoggingConfig.create = function create(properties) { - return new StackdriverLoggingConfig(properties); - }; - - /** - * Encodes the specified StackdriverLoggingConfig message. Does not implicitly {@link google.cloud.tasks.v2.StackdriverLoggingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2.IStackdriverLoggingConfig} message StackdriverLoggingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StackdriverLoggingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.samplingRatio != null && Object.hasOwnProperty.call(message, "samplingRatio")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.samplingRatio); - return writer; - }; - - /** - * Encodes the specified StackdriverLoggingConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.StackdriverLoggingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2.IStackdriverLoggingConfig} message StackdriverLoggingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StackdriverLoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.StackdriverLoggingConfig} StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StackdriverLoggingConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.StackdriverLoggingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.samplingRatio = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.StackdriverLoggingConfig} StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StackdriverLoggingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StackdriverLoggingConfig message. - * @function verify - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StackdriverLoggingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.samplingRatio != null && message.hasOwnProperty("samplingRatio")) - if (typeof message.samplingRatio !== "number") - return "samplingRatio: number expected"; - return null; - }; - - /** - * Creates a StackdriverLoggingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.StackdriverLoggingConfig} StackdriverLoggingConfig - */ - StackdriverLoggingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.StackdriverLoggingConfig) - return object; - var message = new $root.google.cloud.tasks.v2.StackdriverLoggingConfig(); - if (object.samplingRatio != null) - message.samplingRatio = Number(object.samplingRatio); - return message; - }; - - /** - * Creates a plain object from a StackdriverLoggingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2.StackdriverLoggingConfig} message StackdriverLoggingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StackdriverLoggingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.samplingRatio = 0; - if (message.samplingRatio != null && message.hasOwnProperty("samplingRatio")) - object.samplingRatio = options.json && !isFinite(message.samplingRatio) ? String(message.samplingRatio) : message.samplingRatio; - return object; - }; - - /** - * Converts this StackdriverLoggingConfig to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @instance - * @returns {Object.} JSON object - */ - StackdriverLoggingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StackdriverLoggingConfig - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.StackdriverLoggingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StackdriverLoggingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.StackdriverLoggingConfig"; - }; - - return StackdriverLoggingConfig; - })(); - - v2.HttpRequest = (function() { - - /** - * Properties of a HttpRequest. - * @memberof google.cloud.tasks.v2 - * @interface IHttpRequest - * @property {string|null} [url] HttpRequest url - * @property {google.cloud.tasks.v2.HttpMethod|null} [httpMethod] HttpRequest httpMethod - * @property {Object.|null} [headers] HttpRequest headers - * @property {Uint8Array|null} [body] HttpRequest body - * @property {google.cloud.tasks.v2.IOAuthToken|null} [oauthToken] HttpRequest oauthToken - * @property {google.cloud.tasks.v2.IOidcToken|null} [oidcToken] HttpRequest oidcToken - */ - - /** - * Constructs a new HttpRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a HttpRequest. - * @implements IHttpRequest - * @constructor - * @param {google.cloud.tasks.v2.IHttpRequest=} [properties] Properties to set - */ - function HttpRequest(properties) { - this.headers = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRequest url. - * @member {string} url - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - HttpRequest.prototype.url = ""; - - /** - * HttpRequest httpMethod. - * @member {google.cloud.tasks.v2.HttpMethod} httpMethod - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - HttpRequest.prototype.httpMethod = 0; - - /** - * HttpRequest headers. - * @member {Object.} headers - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - HttpRequest.prototype.headers = $util.emptyObject; - - /** - * HttpRequest body. - * @member {Uint8Array} body - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - HttpRequest.prototype.body = $util.newBuffer([]); - - /** - * HttpRequest oauthToken. - * @member {google.cloud.tasks.v2.IOAuthToken|null|undefined} oauthToken - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - HttpRequest.prototype.oauthToken = null; - - /** - * HttpRequest oidcToken. - * @member {google.cloud.tasks.v2.IOidcToken|null|undefined} oidcToken - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - HttpRequest.prototype.oidcToken = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRequest authorizationHeader. - * @member {"oauthToken"|"oidcToken"|undefined} authorizationHeader - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - */ - Object.defineProperty(HttpRequest.prototype, "authorizationHeader", { - get: $util.oneOfGetter($oneOfFields = ["oauthToken", "oidcToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {google.cloud.tasks.v2.IHttpRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.HttpRequest} HttpRequest instance - */ - HttpRequest.create = function create(properties) { - return new HttpRequest(properties); - }; - - /** - * Encodes the specified HttpRequest message. Does not implicitly {@link google.cloud.tasks.v2.HttpRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {google.cloud.tasks.v2.IHttpRequest} message HttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.httpMethod); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.body); - if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) - $root.google.cloud.tasks.v2.OAuthToken.encode(message.oauthToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken")) - $root.google.cloud.tasks.v2.OidcToken.encode(message.oidcToken, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.HttpRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {google.cloud.tasks.v2.IHttpRequest} message HttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.HttpRequest} HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.HttpRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.url = reader.string(); - break; - } - case 2: { - message.httpMethod = reader.int32(); - break; - } - case 3: { - if (message.headers === $util.emptyObject) - message.headers = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.headers[key] = value; - break; - } - case 4: { - message.body = reader.bytes(); - break; - } - case 5: { - message.oauthToken = $root.google.cloud.tasks.v2.OAuthToken.decode(reader, reader.uint32()); - break; - } - case 6: { - message.oidcToken = $root.google.cloud.tasks.v2.OidcToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.HttpRequest} HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - switch (message.httpMethod) { - default: - return "httpMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; - } - if (message.body != null && message.hasOwnProperty("body")) - if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body))) - return "body: buffer expected"; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) { - properties.authorizationHeader = 1; - { - var error = $root.google.cloud.tasks.v2.OAuthToken.verify(message.oauthToken); - if (error) - return "oauthToken." + error; - } - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - if (properties.authorizationHeader === 1) - return "authorizationHeader: multiple values"; - properties.authorizationHeader = 1; - { - var error = $root.google.cloud.tasks.v2.OidcToken.verify(message.oidcToken); - if (error) - return "oidcToken." + error; - } - } - return null; - }; - - /** - * Creates a HttpRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.HttpRequest} HttpRequest - */ - HttpRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.HttpRequest) - return object; - var message = new $root.google.cloud.tasks.v2.HttpRequest(); - if (object.url != null) - message.url = String(object.url); - switch (object.httpMethod) { - default: - if (typeof object.httpMethod === "number") { - message.httpMethod = object.httpMethod; - break; - } - break; - case "HTTP_METHOD_UNSPECIFIED": - case 0: - message.httpMethod = 0; - break; - case "POST": - case 1: - message.httpMethod = 1; - break; - case "GET": - case 2: - message.httpMethod = 2; - break; - case "HEAD": - case 3: - message.httpMethod = 3; - break; - case "PUT": - case 4: - message.httpMethod = 4; - break; - case "DELETE": - case 5: - message.httpMethod = 5; - break; - case "PATCH": - case 6: - message.httpMethod = 6; - break; - case "OPTIONS": - case 7: - message.httpMethod = 7; - break; - } - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".google.cloud.tasks.v2.HttpRequest.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); - } - if (object.body != null) - if (typeof object.body === "string") - $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0); - else if (object.body.length >= 0) - message.body = object.body; - if (object.oauthToken != null) { - if (typeof object.oauthToken !== "object") - throw TypeError(".google.cloud.tasks.v2.HttpRequest.oauthToken: object expected"); - message.oauthToken = $root.google.cloud.tasks.v2.OAuthToken.fromObject(object.oauthToken); - } - if (object.oidcToken != null) { - if (typeof object.oidcToken !== "object") - throw TypeError(".google.cloud.tasks.v2.HttpRequest.oidcToken: object expected"); - message.oidcToken = $root.google.cloud.tasks.v2.OidcToken.fromObject(object.oidcToken); - } - return message; - }; - - /** - * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {google.cloud.tasks.v2.HttpRequest} message HttpRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.headers = {}; - if (options.defaults) { - object.url = ""; - object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; - if (options.bytes === String) - object.body = ""; - else { - object.body = []; - if (options.bytes !== Array) - object.body = $util.newBuffer(object.body); - } - } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - object.httpMethod = options.enums === String ? $root.google.cloud.tasks.v2.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.tasks.v2.HttpMethod[message.httpMethod] : message.httpMethod; - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) { - object.oauthToken = $root.google.cloud.tasks.v2.OAuthToken.toObject(message.oauthToken, options); - if (options.oneofs) - object.authorizationHeader = "oauthToken"; - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - object.oidcToken = $root.google.cloud.tasks.v2.OidcToken.toObject(message.oidcToken, options); - if (options.oneofs) - object.authorizationHeader = "oidcToken"; - } - return object; - }; - - /** - * Converts this HttpRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.HttpRequest - * @instance - * @returns {Object.} JSON object - */ - HttpRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.HttpRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.HttpRequest"; - }; - - return HttpRequest; - })(); - - v2.AppEngineHttpRequest = (function() { - - /** - * Properties of an AppEngineHttpRequest. - * @memberof google.cloud.tasks.v2 - * @interface IAppEngineHttpRequest - * @property {google.cloud.tasks.v2.HttpMethod|null} [httpMethod] AppEngineHttpRequest httpMethod - * @property {google.cloud.tasks.v2.IAppEngineRouting|null} [appEngineRouting] AppEngineHttpRequest appEngineRouting - * @property {string|null} [relativeUri] AppEngineHttpRequest relativeUri - * @property {Object.|null} [headers] AppEngineHttpRequest headers - * @property {Uint8Array|null} [body] AppEngineHttpRequest body - */ - - /** - * Constructs a new AppEngineHttpRequest. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents an AppEngineHttpRequest. - * @implements IAppEngineHttpRequest - * @constructor - * @param {google.cloud.tasks.v2.IAppEngineHttpRequest=} [properties] Properties to set - */ - function AppEngineHttpRequest(properties) { - this.headers = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineHttpRequest httpMethod. - * @member {google.cloud.tasks.v2.HttpMethod} httpMethod - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.httpMethod = 0; - - /** - * AppEngineHttpRequest appEngineRouting. - * @member {google.cloud.tasks.v2.IAppEngineRouting|null|undefined} appEngineRouting - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.appEngineRouting = null; - - /** - * AppEngineHttpRequest relativeUri. - * @member {string} relativeUri - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.relativeUri = ""; - - /** - * AppEngineHttpRequest headers. - * @member {Object.} headers - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.headers = $util.emptyObject; - - /** - * AppEngineHttpRequest body. - * @member {Uint8Array} body - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.body = $util.newBuffer([]); - - /** - * Creates a new AppEngineHttpRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2.IAppEngineHttpRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.AppEngineHttpRequest} AppEngineHttpRequest instance - */ - AppEngineHttpRequest.create = function create(properties) { - return new AppEngineHttpRequest(properties); - }; - - /** - * Encodes the specified AppEngineHttpRequest message. Does not implicitly {@link google.cloud.tasks.v2.AppEngineHttpRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2.IAppEngineHttpRequest} message AppEngineHttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.httpMethod); - if (message.appEngineRouting != null && Object.hasOwnProperty.call(message, "appEngineRouting")) - $root.google.cloud.tasks.v2.AppEngineRouting.encode(message.appEngineRouting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.relativeUri != null && Object.hasOwnProperty.call(message, "relativeUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relativeUri); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.body); - return writer; - }; - - /** - * Encodes the specified AppEngineHttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.AppEngineHttpRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2.IAppEngineHttpRequest} message AppEngineHttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.AppEngineHttpRequest} AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.AppEngineHttpRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.httpMethod = reader.int32(); - break; - } - case 2: { - message.appEngineRouting = $root.google.cloud.tasks.v2.AppEngineRouting.decode(reader, reader.uint32()); - break; - } - case 3: { - message.relativeUri = reader.string(); - break; - } - case 4: { - if (message.headers === $util.emptyObject) - message.headers = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.headers[key] = value; - break; - } - case 5: { - message.body = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.AppEngineHttpRequest} AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineHttpRequest message. - * @function verify - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineHttpRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - switch (message.httpMethod) { - default: - return "httpMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.appEngineRouting != null && message.hasOwnProperty("appEngineRouting")) { - var error = $root.google.cloud.tasks.v2.AppEngineRouting.verify(message.appEngineRouting); - if (error) - return "appEngineRouting." + error; - } - if (message.relativeUri != null && message.hasOwnProperty("relativeUri")) - if (!$util.isString(message.relativeUri)) - return "relativeUri: string expected"; - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; - } - if (message.body != null && message.hasOwnProperty("body")) - if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body))) - return "body: buffer expected"; - return null; - }; - - /** - * Creates an AppEngineHttpRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.AppEngineHttpRequest} AppEngineHttpRequest - */ - AppEngineHttpRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.AppEngineHttpRequest) - return object; - var message = new $root.google.cloud.tasks.v2.AppEngineHttpRequest(); - switch (object.httpMethod) { - default: - if (typeof object.httpMethod === "number") { - message.httpMethod = object.httpMethod; - break; - } - break; - case "HTTP_METHOD_UNSPECIFIED": - case 0: - message.httpMethod = 0; - break; - case "POST": - case 1: - message.httpMethod = 1; - break; - case "GET": - case 2: - message.httpMethod = 2; - break; - case "HEAD": - case 3: - message.httpMethod = 3; - break; - case "PUT": - case 4: - message.httpMethod = 4; - break; - case "DELETE": - case 5: - message.httpMethod = 5; - break; - case "PATCH": - case 6: - message.httpMethod = 6; - break; - case "OPTIONS": - case 7: - message.httpMethod = 7; - break; - } - if (object.appEngineRouting != null) { - if (typeof object.appEngineRouting !== "object") - throw TypeError(".google.cloud.tasks.v2.AppEngineHttpRequest.appEngineRouting: object expected"); - message.appEngineRouting = $root.google.cloud.tasks.v2.AppEngineRouting.fromObject(object.appEngineRouting); - } - if (object.relativeUri != null) - message.relativeUri = String(object.relativeUri); - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".google.cloud.tasks.v2.AppEngineHttpRequest.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); - } - if (object.body != null) - if (typeof object.body === "string") - $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0); - else if (object.body.length >= 0) - message.body = object.body; - return message; - }; - - /** - * Creates a plain object from an AppEngineHttpRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2.AppEngineHttpRequest} message AppEngineHttpRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineHttpRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.headers = {}; - if (options.defaults) { - object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; - object.appEngineRouting = null; - object.relativeUri = ""; - if (options.bytes === String) - object.body = ""; - else { - object.body = []; - if (options.bytes !== Array) - object.body = $util.newBuffer(object.body); - } - } - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - object.httpMethod = options.enums === String ? $root.google.cloud.tasks.v2.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.tasks.v2.HttpMethod[message.httpMethod] : message.httpMethod; - if (message.appEngineRouting != null && message.hasOwnProperty("appEngineRouting")) - object.appEngineRouting = $root.google.cloud.tasks.v2.AppEngineRouting.toObject(message.appEngineRouting, options); - if (message.relativeUri != null && message.hasOwnProperty("relativeUri")) - object.relativeUri = message.relativeUri; - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body; - return object; - }; - - /** - * Converts this AppEngineHttpRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @instance - * @returns {Object.} JSON object - */ - AppEngineHttpRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineHttpRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.AppEngineHttpRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineHttpRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.AppEngineHttpRequest"; - }; - - return AppEngineHttpRequest; - })(); - - v2.AppEngineRouting = (function() { - - /** - * Properties of an AppEngineRouting. - * @memberof google.cloud.tasks.v2 - * @interface IAppEngineRouting - * @property {string|null} [service] AppEngineRouting service - * @property {string|null} [version] AppEngineRouting version - * @property {string|null} [instance] AppEngineRouting instance - * @property {string|null} [host] AppEngineRouting host - */ - - /** - * Constructs a new AppEngineRouting. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents an AppEngineRouting. - * @implements IAppEngineRouting - * @constructor - * @param {google.cloud.tasks.v2.IAppEngineRouting=} [properties] Properties to set - */ - function AppEngineRouting(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineRouting service. - * @member {string} service - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.service = ""; - - /** - * AppEngineRouting version. - * @member {string} version - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.version = ""; - - /** - * AppEngineRouting instance. - * @member {string} instance - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.instance = ""; - - /** - * AppEngineRouting host. - * @member {string} host - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.host = ""; - - /** - * Creates a new AppEngineRouting instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2.IAppEngineRouting=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.AppEngineRouting} AppEngineRouting instance - */ - AppEngineRouting.create = function create(properties) { - return new AppEngineRouting(properties); - }; - - /** - * Encodes the specified AppEngineRouting message. Does not implicitly {@link google.cloud.tasks.v2.AppEngineRouting.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2.IAppEngineRouting} message AppEngineRouting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineRouting.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instance); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - return writer; - }; - - /** - * Encodes the specified AppEngineRouting message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.AppEngineRouting.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2.IAppEngineRouting} message AppEngineRouting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineRouting.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.AppEngineRouting} AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineRouting.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.AppEngineRouting(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.instance = reader.string(); - break; - } - case 4: { - message.host = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.AppEngineRouting} AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineRouting.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineRouting message. - * @function verify - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineRouting.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) - if (!$util.isString(message.instance)) - return "instance: string expected"; - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - return null; - }; - - /** - * Creates an AppEngineRouting message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.AppEngineRouting} AppEngineRouting - */ - AppEngineRouting.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.AppEngineRouting) - return object; - var message = new $root.google.cloud.tasks.v2.AppEngineRouting(); - if (object.service != null) - message.service = String(object.service); - if (object.version != null) - message.version = String(object.version); - if (object.instance != null) - message.instance = String(object.instance); - if (object.host != null) - message.host = String(object.host); - return message; - }; - - /** - * Creates a plain object from an AppEngineRouting message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2.AppEngineRouting} message AppEngineRouting - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineRouting.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.service = ""; - object.version = ""; - object.instance = ""; - object.host = ""; - } - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = message.instance; - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - return object; - }; - - /** - * Converts this AppEngineRouting to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @instance - * @returns {Object.} JSON object - */ - AppEngineRouting.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineRouting - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.AppEngineRouting - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineRouting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.AppEngineRouting"; - }; - - return AppEngineRouting; - })(); - - /** - * HttpMethod enum. - * @name google.cloud.tasks.v2.HttpMethod - * @enum {number} - * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value - * @property {number} POST=1 POST value - * @property {number} GET=2 GET value - * @property {number} HEAD=3 HEAD value - * @property {number} PUT=4 PUT value - * @property {number} DELETE=5 DELETE value - * @property {number} PATCH=6 PATCH value - * @property {number} OPTIONS=7 OPTIONS value - */ - v2.HttpMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "POST"] = 1; - values[valuesById[2] = "GET"] = 2; - values[valuesById[3] = "HEAD"] = 3; - values[valuesById[4] = "PUT"] = 4; - values[valuesById[5] = "DELETE"] = 5; - values[valuesById[6] = "PATCH"] = 6; - values[valuesById[7] = "OPTIONS"] = 7; - return values; - })(); - - v2.OAuthToken = (function() { - - /** - * Properties of a OAuthToken. - * @memberof google.cloud.tasks.v2 - * @interface IOAuthToken - * @property {string|null} [serviceAccountEmail] OAuthToken serviceAccountEmail - * @property {string|null} [scope] OAuthToken scope - */ - - /** - * Constructs a new OAuthToken. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a OAuthToken. - * @implements IOAuthToken - * @constructor - * @param {google.cloud.tasks.v2.IOAuthToken=} [properties] Properties to set - */ - function OAuthToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OAuthToken serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.tasks.v2.OAuthToken - * @instance - */ - OAuthToken.prototype.serviceAccountEmail = ""; - - /** - * OAuthToken scope. - * @member {string} scope - * @memberof google.cloud.tasks.v2.OAuthToken - * @instance - */ - OAuthToken.prototype.scope = ""; - - /** - * Creates a new OAuthToken instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {google.cloud.tasks.v2.IOAuthToken=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.OAuthToken} OAuthToken instance - */ - OAuthToken.create = function create(properties) { - return new OAuthToken(properties); - }; - - /** - * Encodes the specified OAuthToken message. Does not implicitly {@link google.cloud.tasks.v2.OAuthToken.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {google.cloud.tasks.v2.IOAuthToken} message OAuthToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scope); - return writer; - }; - - /** - * Encodes the specified OAuthToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.OAuthToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {google.cloud.tasks.v2.IOAuthToken} message OAuthToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a OAuthToken message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.OAuthToken} OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthToken.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.OAuthToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.serviceAccountEmail = reader.string(); - break; - } - case 2: { - message.scope = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a OAuthToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.OAuthToken} OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a OAuthToken message. - * @function verify - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OAuthToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - return null; - }; - - /** - * Creates a OAuthToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.OAuthToken} OAuthToken - */ - OAuthToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.OAuthToken) - return object; - var message = new $root.google.cloud.tasks.v2.OAuthToken(); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.scope != null) - message.scope = String(object.scope); - return message; - }; - - /** - * Creates a plain object from a OAuthToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {google.cloud.tasks.v2.OAuthToken} message OAuthToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OAuthToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceAccountEmail = ""; - object.scope = ""; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - return object; - }; - - /** - * Converts this OAuthToken to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.OAuthToken - * @instance - * @returns {Object.} JSON object - */ - OAuthToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OAuthToken - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.OAuthToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OAuthToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.OAuthToken"; - }; - - return OAuthToken; - })(); - - v2.OidcToken = (function() { - - /** - * Properties of an OidcToken. - * @memberof google.cloud.tasks.v2 - * @interface IOidcToken - * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail - * @property {string|null} [audience] OidcToken audience - */ - - /** - * Constructs a new OidcToken. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents an OidcToken. - * @implements IOidcToken - * @constructor - * @param {google.cloud.tasks.v2.IOidcToken=} [properties] Properties to set - */ - function OidcToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OidcToken serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.tasks.v2.OidcToken - * @instance - */ - OidcToken.prototype.serviceAccountEmail = ""; - - /** - * OidcToken audience. - * @member {string} audience - * @memberof google.cloud.tasks.v2.OidcToken - * @instance - */ - OidcToken.prototype.audience = ""; - - /** - * Creates a new OidcToken instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {google.cloud.tasks.v2.IOidcToken=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.OidcToken} OidcToken instance - */ - OidcToken.create = function create(properties) { - return new OidcToken(properties); - }; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.cloud.tasks.v2.OidcToken.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {google.cloud.tasks.v2.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); - return writer; - }; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.OidcToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {google.cloud.tasks.v2.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.OidcToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.serviceAccountEmail = reader.string(); - break; - } - case 2: { - message.audience = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OidcToken message. - * @function verify - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OidcToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.audience != null && message.hasOwnProperty("audience")) - if (!$util.isString(message.audience)) - return "audience: string expected"; - return null; - }; - - /** - * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.OidcToken} OidcToken - */ - OidcToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.OidcToken) - return object; - var message = new $root.google.cloud.tasks.v2.OidcToken(); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.audience != null) - message.audience = String(object.audience); - return message; - }; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {google.cloud.tasks.v2.OidcToken} message OidcToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OidcToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceAccountEmail = ""; - object.audience = ""; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = message.audience; - return object; - }; - - /** - * Converts this OidcToken to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.OidcToken - * @instance - * @returns {Object.} JSON object - */ - OidcToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OidcToken - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.OidcToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OidcToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.OidcToken"; - }; - - return OidcToken; - })(); - - v2.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.tasks.v2 - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.tasks.v2.IAppEngineHttpRequest|null} [appEngineHttpRequest] Task appEngineHttpRequest - * @property {google.cloud.tasks.v2.IHttpRequest|null} [httpRequest] Task httpRequest - * @property {google.protobuf.ITimestamp|null} [scheduleTime] Task scheduleTime - * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime - * @property {google.protobuf.IDuration|null} [dispatchDeadline] Task dispatchDeadline - * @property {number|null} [dispatchCount] Task dispatchCount - * @property {number|null} [responseCount] Task responseCount - * @property {google.cloud.tasks.v2.IAttempt|null} [firstAttempt] Task firstAttempt - * @property {google.cloud.tasks.v2.IAttempt|null} [lastAttempt] Task lastAttempt - * @property {google.cloud.tasks.v2.Task.View|null} [view] Task view - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.tasks.v2.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task appEngineHttpRequest. - * @member {google.cloud.tasks.v2.IAppEngineHttpRequest|null|undefined} appEngineHttpRequest - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.appEngineHttpRequest = null; - - /** - * Task httpRequest. - * @member {google.cloud.tasks.v2.IHttpRequest|null|undefined} httpRequest - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.httpRequest = null; - - /** - * Task scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.scheduleTime = null; - - /** - * Task createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.createTime = null; - - /** - * Task dispatchDeadline. - * @member {google.protobuf.IDuration|null|undefined} dispatchDeadline - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.dispatchDeadline = null; - - /** - * Task dispatchCount. - * @member {number} dispatchCount - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.dispatchCount = 0; - - /** - * Task responseCount. - * @member {number} responseCount - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.responseCount = 0; - - /** - * Task firstAttempt. - * @member {google.cloud.tasks.v2.IAttempt|null|undefined} firstAttempt - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.firstAttempt = null; - - /** - * Task lastAttempt. - * @member {google.cloud.tasks.v2.IAttempt|null|undefined} lastAttempt - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.lastAttempt = null; - - /** - * Task view. - * @member {google.cloud.tasks.v2.Task.View} view - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Task.prototype.view = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Task messageType. - * @member {"appEngineHttpRequest"|"httpRequest"|undefined} messageType - * @memberof google.cloud.tasks.v2.Task - * @instance - */ - Object.defineProperty(Task.prototype, "messageType", { - get: $util.oneOfGetter($oneOfFields = ["appEngineHttpRequest", "httpRequest"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {google.cloud.tasks.v2.ITask=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.tasks.v2.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {google.cloud.tasks.v2.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.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.appEngineHttpRequest != null && Object.hasOwnProperty.call(message, "appEngineHttpRequest")) - $root.google.cloud.tasks.v2.AppEngineHttpRequest.encode(message.appEngineHttpRequest, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.httpRequest != null && Object.hasOwnProperty.call(message, "httpRequest")) - $root.google.cloud.tasks.v2.HttpRequest.encode(message.httpRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.dispatchDeadline != null && Object.hasOwnProperty.call(message, "dispatchDeadline")) - $root.google.protobuf.Duration.encode(message.dispatchDeadline, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.dispatchCount != null && Object.hasOwnProperty.call(message, "dispatchCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.dispatchCount); - if (message.responseCount != null && Object.hasOwnProperty.call(message, "responseCount")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.responseCount); - if (message.firstAttempt != null && Object.hasOwnProperty.call(message, "firstAttempt")) - $root.google.cloud.tasks.v2.Attempt.encode(message.firstAttempt, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.lastAttempt != null && Object.hasOwnProperty.call(message, "lastAttempt")) - $root.google.cloud.tasks.v2.Attempt.encode(message.lastAttempt, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.view); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {google.cloud.tasks.v2.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.appEngineHttpRequest = $root.google.cloud.tasks.v2.AppEngineHttpRequest.decode(reader, reader.uint32()); - break; - } - case 3: { - message.httpRequest = $root.google.cloud.tasks.v2.HttpRequest.decode(reader, reader.uint32()); - break; - } - case 4: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.dispatchDeadline = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 7: { - message.dispatchCount = reader.int32(); - break; - } - case 8: { - message.responseCount = reader.int32(); - break; - } - case 9: { - message.firstAttempt = $root.google.cloud.tasks.v2.Attempt.decode(reader, reader.uint32()); - break; - } - case 10: { - message.lastAttempt = $root.google.cloud.tasks.v2.Attempt.decode(reader, reader.uint32()); - break; - } - case 11: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.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.appEngineHttpRequest != null && message.hasOwnProperty("appEngineHttpRequest")) { - properties.messageType = 1; - { - var error = $root.google.cloud.tasks.v2.AppEngineHttpRequest.verify(message.appEngineHttpRequest); - if (error) - return "appEngineHttpRequest." + error; - } - } - if (message.httpRequest != null && message.hasOwnProperty("httpRequest")) { - if (properties.messageType === 1) - return "messageType: multiple values"; - properties.messageType = 1; - { - var error = $root.google.cloud.tasks.v2.HttpRequest.verify(message.httpRequest); - if (error) - return "httpRequest." + error; - } - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.dispatchDeadline != null && message.hasOwnProperty("dispatchDeadline")) { - var error = $root.google.protobuf.Duration.verify(message.dispatchDeadline); - if (error) - return "dispatchDeadline." + error; - } - if (message.dispatchCount != null && message.hasOwnProperty("dispatchCount")) - if (!$util.isInteger(message.dispatchCount)) - return "dispatchCount: integer expected"; - if (message.responseCount != null && message.hasOwnProperty("responseCount")) - if (!$util.isInteger(message.responseCount)) - return "responseCount: integer expected"; - if (message.firstAttempt != null && message.hasOwnProperty("firstAttempt")) { - var error = $root.google.cloud.tasks.v2.Attempt.verify(message.firstAttempt); - if (error) - return "firstAttempt." + error; - } - if (message.lastAttempt != null && message.hasOwnProperty("lastAttempt")) { - var error = $root.google.cloud.tasks.v2.Attempt.verify(message.lastAttempt); - if (error) - return "lastAttempt." + error; - } - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.Task) - return object; - var message = new $root.google.cloud.tasks.v2.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.appEngineHttpRequest != null) { - if (typeof object.appEngineHttpRequest !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.appEngineHttpRequest: object expected"); - message.appEngineHttpRequest = $root.google.cloud.tasks.v2.AppEngineHttpRequest.fromObject(object.appEngineHttpRequest); - } - if (object.httpRequest != null) { - if (typeof object.httpRequest !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.httpRequest: object expected"); - message.httpRequest = $root.google.cloud.tasks.v2.HttpRequest.fromObject(object.httpRequest); - } - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.dispatchDeadline != null) { - if (typeof object.dispatchDeadline !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.dispatchDeadline: object expected"); - message.dispatchDeadline = $root.google.protobuf.Duration.fromObject(object.dispatchDeadline); - } - if (object.dispatchCount != null) - message.dispatchCount = object.dispatchCount | 0; - if (object.responseCount != null) - message.responseCount = object.responseCount | 0; - if (object.firstAttempt != null) { - if (typeof object.firstAttempt !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.firstAttempt: object expected"); - message.firstAttempt = $root.google.cloud.tasks.v2.Attempt.fromObject(object.firstAttempt); - } - if (object.lastAttempt != null) { - if (typeof object.lastAttempt !== "object") - throw TypeError(".google.cloud.tasks.v2.Task.lastAttempt: object expected"); - message.lastAttempt = $root.google.cloud.tasks.v2.Attempt.fromObject(object.lastAttempt); - } - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BASIC": - case 1: - message.view = 1; - break; - case "FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {google.cloud.tasks.v2.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.scheduleTime = null; - object.createTime = null; - object.dispatchDeadline = null; - object.dispatchCount = 0; - object.responseCount = 0; - object.firstAttempt = null; - object.lastAttempt = null; - object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appEngineHttpRequest != null && message.hasOwnProperty("appEngineHttpRequest")) { - object.appEngineHttpRequest = $root.google.cloud.tasks.v2.AppEngineHttpRequest.toObject(message.appEngineHttpRequest, options); - if (options.oneofs) - object.messageType = "appEngineHttpRequest"; - } - if (message.httpRequest != null && message.hasOwnProperty("httpRequest")) { - object.httpRequest = $root.google.cloud.tasks.v2.HttpRequest.toObject(message.httpRequest, options); - if (options.oneofs) - object.messageType = "httpRequest"; - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.dispatchDeadline != null && message.hasOwnProperty("dispatchDeadline")) - object.dispatchDeadline = $root.google.protobuf.Duration.toObject(message.dispatchDeadline, options); - if (message.dispatchCount != null && message.hasOwnProperty("dispatchCount")) - object.dispatchCount = message.dispatchCount; - if (message.responseCount != null && message.hasOwnProperty("responseCount")) - object.responseCount = message.responseCount; - if (message.firstAttempt != null && message.hasOwnProperty("firstAttempt")) - object.firstAttempt = $root.google.cloud.tasks.v2.Attempt.toObject(message.firstAttempt, options); - if (message.lastAttempt != null && message.hasOwnProperty("lastAttempt")) - object.lastAttempt = $root.google.cloud.tasks.v2.Attempt.toObject(message.lastAttempt, options); - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.tasks.v2.Task.View[message.view] === undefined ? message.view : $root.google.cloud.tasks.v2.Task.View[message.view] : message.view; - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.Task"; - }; - - /** - * View enum. - * @name google.cloud.tasks.v2.Task.View - * @enum {number} - * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value - * @property {number} BASIC=1 BASIC value - * @property {number} FULL=2 FULL value - */ - Task.View = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "BASIC"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); - - return Task; - })(); - - v2.Attempt = (function() { - - /** - * Properties of an Attempt. - * @memberof google.cloud.tasks.v2 - * @interface IAttempt - * @property {google.protobuf.ITimestamp|null} [scheduleTime] Attempt scheduleTime - * @property {google.protobuf.ITimestamp|null} [dispatchTime] Attempt dispatchTime - * @property {google.protobuf.ITimestamp|null} [responseTime] Attempt responseTime - * @property {google.rpc.IStatus|null} [responseStatus] Attempt responseStatus - */ - - /** - * Constructs a new Attempt. - * @memberof google.cloud.tasks.v2 - * @classdesc Represents an Attempt. - * @implements IAttempt - * @constructor - * @param {google.cloud.tasks.v2.IAttempt=} [properties] Properties to set - */ - function Attempt(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attempt scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2.Attempt - * @instance - */ - Attempt.prototype.scheduleTime = null; - - /** - * Attempt dispatchTime. - * @member {google.protobuf.ITimestamp|null|undefined} dispatchTime - * @memberof google.cloud.tasks.v2.Attempt - * @instance - */ - Attempt.prototype.dispatchTime = null; - - /** - * Attempt responseTime. - * @member {google.protobuf.ITimestamp|null|undefined} responseTime - * @memberof google.cloud.tasks.v2.Attempt - * @instance - */ - Attempt.prototype.responseTime = null; - - /** - * Attempt responseStatus. - * @member {google.rpc.IStatus|null|undefined} responseStatus - * @memberof google.cloud.tasks.v2.Attempt - * @instance - */ - Attempt.prototype.responseStatus = null; - - /** - * Creates a new Attempt instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {google.cloud.tasks.v2.IAttempt=} [properties] Properties to set - * @returns {google.cloud.tasks.v2.Attempt} Attempt instance - */ - Attempt.create = function create(properties) { - return new Attempt(properties); - }; - - /** - * Encodes the specified Attempt message. Does not implicitly {@link google.cloud.tasks.v2.Attempt.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {google.cloud.tasks.v2.IAttempt} message Attempt message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attempt.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dispatchTime != null && Object.hasOwnProperty.call(message, "dispatchTime")) - $root.google.protobuf.Timestamp.encode(message.dispatchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseTime != null && Object.hasOwnProperty.call(message, "responseTime")) - $root.google.protobuf.Timestamp.encode(message.responseTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.responseStatus != null && Object.hasOwnProperty.call(message, "responseStatus")) - $root.google.rpc.Status.encode(message.responseStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Attempt message, length delimited. Does not implicitly {@link google.cloud.tasks.v2.Attempt.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {google.cloud.tasks.v2.IAttempt} message Attempt message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attempt.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attempt message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2.Attempt} Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attempt.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2.Attempt(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.dispatchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.responseStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attempt message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2.Attempt} Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attempt.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attempt message. - * @function verify - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attempt.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.dispatchTime != null && message.hasOwnProperty("dispatchTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.dispatchTime); - if (error) - return "dispatchTime." + error; - } - if (message.responseTime != null && message.hasOwnProperty("responseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.responseTime); - if (error) - return "responseTime." + error; - } - if (message.responseStatus != null && message.hasOwnProperty("responseStatus")) { - var error = $root.google.rpc.Status.verify(message.responseStatus); - if (error) - return "responseStatus." + error; - } - return null; - }; - - /** - * Creates an Attempt message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2.Attempt} Attempt - */ - Attempt.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2.Attempt) - return object; - var message = new $root.google.cloud.tasks.v2.Attempt(); - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2.Attempt.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.dispatchTime != null) { - if (typeof object.dispatchTime !== "object") - throw TypeError(".google.cloud.tasks.v2.Attempt.dispatchTime: object expected"); - message.dispatchTime = $root.google.protobuf.Timestamp.fromObject(object.dispatchTime); - } - if (object.responseTime != null) { - if (typeof object.responseTime !== "object") - throw TypeError(".google.cloud.tasks.v2.Attempt.responseTime: object expected"); - message.responseTime = $root.google.protobuf.Timestamp.fromObject(object.responseTime); - } - if (object.responseStatus != null) { - if (typeof object.responseStatus !== "object") - throw TypeError(".google.cloud.tasks.v2.Attempt.responseStatus: object expected"); - message.responseStatus = $root.google.rpc.Status.fromObject(object.responseStatus); - } - return message; - }; - - /** - * Creates a plain object from an Attempt message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {google.cloud.tasks.v2.Attempt} message Attempt - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attempt.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scheduleTime = null; - object.dispatchTime = null; - object.responseTime = null; - object.responseStatus = null; - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.dispatchTime != null && message.hasOwnProperty("dispatchTime")) - object.dispatchTime = $root.google.protobuf.Timestamp.toObject(message.dispatchTime, options); - if (message.responseTime != null && message.hasOwnProperty("responseTime")) - object.responseTime = $root.google.protobuf.Timestamp.toObject(message.responseTime, options); - if (message.responseStatus != null && message.hasOwnProperty("responseStatus")) - object.responseStatus = $root.google.rpc.Status.toObject(message.responseStatus, options); - return object; - }; - - /** - * Converts this Attempt to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2.Attempt - * @instance - * @returns {Object.} JSON object - */ - Attempt.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attempt - * @function getTypeUrl - * @memberof google.cloud.tasks.v2.Attempt - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attempt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2.Attempt"; - }; - - return Attempt; - })(); - - return v2; - })(); - - tasks.v2beta2 = (function() { - - /** - * Namespace v2beta2. - * @memberof google.cloud.tasks - * @namespace - */ - var v2beta2 = {}; - - v2beta2.CloudTasks = (function() { - - /** - * Constructs a new CloudTasks service. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a CloudTasks - * @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 CloudTasks(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CloudTasks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudTasks; - - /** - * Creates new CloudTasks service using the specified rpc implementation. - * @function create - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @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 {CloudTasks} RPC service. Useful where requests and/or responses are streamed. - */ - CloudTasks.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|listQueues}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef ListQueuesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.ListQueuesResponse} [response] ListQueuesResponse - */ - - /** - * Calls ListQueues. - * @function listQueues - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IListQueuesRequest} request ListQueuesRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.ListQueuesCallback} callback Node-style callback called with the error, if any, and ListQueuesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.listQueues = function listQueues(request, callback) { - return this.rpcCall(listQueues, $root.google.cloud.tasks.v2beta2.ListQueuesRequest, $root.google.cloud.tasks.v2beta2.ListQueuesResponse, request, callback); - }, "name", { value: "ListQueues" }); - - /** - * Calls ListQueues. - * @function listQueues - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IListQueuesRequest} request ListQueuesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|getQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef GetQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Queue} [response] Queue - */ - - /** - * Calls GetQueue. - * @function getQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IGetQueueRequest} request GetQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.GetQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getQueue = function getQueue(request, callback) { - return this.rpcCall(getQueue, $root.google.cloud.tasks.v2beta2.GetQueueRequest, $root.google.cloud.tasks.v2beta2.Queue, request, callback); - }, "name", { value: "GetQueue" }); - - /** - * Calls GetQueue. - * @function getQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IGetQueueRequest} request GetQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|createQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef CreateQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Queue} [response] Queue - */ - - /** - * Calls CreateQueue. - * @function createQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ICreateQueueRequest} request CreateQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.CreateQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.createQueue = function createQueue(request, callback) { - return this.rpcCall(createQueue, $root.google.cloud.tasks.v2beta2.CreateQueueRequest, $root.google.cloud.tasks.v2beta2.Queue, request, callback); - }, "name", { value: "CreateQueue" }); - - /** - * Calls CreateQueue. - * @function createQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ICreateQueueRequest} request CreateQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|updateQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef UpdateQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Queue} [response] Queue - */ - - /** - * Calls UpdateQueue. - * @function updateQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IUpdateQueueRequest} request UpdateQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.UpdateQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.updateQueue = function updateQueue(request, callback) { - return this.rpcCall(updateQueue, $root.google.cloud.tasks.v2beta2.UpdateQueueRequest, $root.google.cloud.tasks.v2beta2.Queue, request, callback); - }, "name", { value: "UpdateQueue" }); - - /** - * Calls UpdateQueue. - * @function updateQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IUpdateQueueRequest} request UpdateQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|deleteQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef DeleteQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteQueue. - * @function deleteQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IDeleteQueueRequest} request DeleteQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.DeleteQueueCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.deleteQueue = function deleteQueue(request, callback) { - return this.rpcCall(deleteQueue, $root.google.cloud.tasks.v2beta2.DeleteQueueRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteQueue" }); - - /** - * Calls DeleteQueue. - * @function deleteQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IDeleteQueueRequest} request DeleteQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|purgeQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef PurgeQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Queue} [response] Queue - */ - - /** - * Calls PurgeQueue. - * @function purgeQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IPurgeQueueRequest} request PurgeQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.PurgeQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.purgeQueue = function purgeQueue(request, callback) { - return this.rpcCall(purgeQueue, $root.google.cloud.tasks.v2beta2.PurgeQueueRequest, $root.google.cloud.tasks.v2beta2.Queue, request, callback); - }, "name", { value: "PurgeQueue" }); - - /** - * Calls PurgeQueue. - * @function purgeQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IPurgeQueueRequest} request PurgeQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|pauseQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef PauseQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Queue} [response] Queue - */ - - /** - * Calls PauseQueue. - * @function pauseQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IPauseQueueRequest} request PauseQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.PauseQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.pauseQueue = function pauseQueue(request, callback) { - return this.rpcCall(pauseQueue, $root.google.cloud.tasks.v2beta2.PauseQueueRequest, $root.google.cloud.tasks.v2beta2.Queue, request, callback); - }, "name", { value: "PauseQueue" }); - - /** - * Calls PauseQueue. - * @function pauseQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IPauseQueueRequest} request PauseQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|resumeQueue}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef ResumeQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Queue} [response] Queue - */ - - /** - * Calls ResumeQueue. - * @function resumeQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IResumeQueueRequest} request ResumeQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.ResumeQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.resumeQueue = function resumeQueue(request, callback) { - return this.rpcCall(resumeQueue, $root.google.cloud.tasks.v2beta2.ResumeQueueRequest, $root.google.cloud.tasks.v2beta2.Queue, request, callback); - }, "name", { value: "ResumeQueue" }); - - /** - * Calls ResumeQueue. - * @function resumeQueue - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IResumeQueueRequest} request ResumeQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|getIamPolicy}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|setIamPolicy}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|testIamPermissions}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|listTasks}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.tasks.v2beta2.ListTasksRequest, $root.google.cloud.tasks.v2beta2.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|getTask}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.tasks.v2beta2.GetTaskRequest, $root.google.cloud.tasks.v2beta2.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|createTask}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef CreateTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Task} [response] Task - */ - - /** - * Calls CreateTask. - * @function createTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ICreateTaskRequest} request CreateTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.CreateTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.createTask = function createTask(request, callback) { - return this.rpcCall(createTask, $root.google.cloud.tasks.v2beta2.CreateTaskRequest, $root.google.cloud.tasks.v2beta2.Task, request, callback); - }, "name", { value: "CreateTask" }); - - /** - * Calls CreateTask. - * @function createTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ICreateTaskRequest} request CreateTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|deleteTask}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef DeleteTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteTask. - * @function deleteTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IDeleteTaskRequest} request DeleteTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.DeleteTaskCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.deleteTask = function deleteTask(request, callback) { - return this.rpcCall(deleteTask, $root.google.cloud.tasks.v2beta2.DeleteTaskRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTask" }); - - /** - * Calls DeleteTask. - * @function deleteTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IDeleteTaskRequest} request DeleteTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|leaseTasks}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef LeaseTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.LeaseTasksResponse} [response] LeaseTasksResponse - */ - - /** - * Calls LeaseTasks. - * @function leaseTasks - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ILeaseTasksRequest} request LeaseTasksRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.LeaseTasksCallback} callback Node-style callback called with the error, if any, and LeaseTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.leaseTasks = function leaseTasks(request, callback) { - return this.rpcCall(leaseTasks, $root.google.cloud.tasks.v2beta2.LeaseTasksRequest, $root.google.cloud.tasks.v2beta2.LeaseTasksResponse, request, callback); - }, "name", { value: "LeaseTasks" }); - - /** - * Calls LeaseTasks. - * @function leaseTasks - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ILeaseTasksRequest} request LeaseTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|acknowledgeTask}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef AcknowledgeTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls AcknowledgeTask. - * @function acknowledgeTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest} request AcknowledgeTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTaskCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.acknowledgeTask = function acknowledgeTask(request, callback) { - return this.rpcCall(acknowledgeTask, $root.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "AcknowledgeTask" }); - - /** - * Calls AcknowledgeTask. - * @function acknowledgeTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest} request AcknowledgeTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|renewLease}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef RenewLeaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Task} [response] Task - */ - - /** - * Calls RenewLease. - * @function renewLease - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IRenewLeaseRequest} request RenewLeaseRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.RenewLeaseCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.renewLease = function renewLease(request, callback) { - return this.rpcCall(renewLease, $root.google.cloud.tasks.v2beta2.RenewLeaseRequest, $root.google.cloud.tasks.v2beta2.Task, request, callback); - }, "name", { value: "RenewLease" }); - - /** - * Calls RenewLease. - * @function renewLease - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IRenewLeaseRequest} request RenewLeaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|cancelLease}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef CancelLeaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Task} [response] Task - */ - - /** - * Calls CancelLease. - * @function cancelLease - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ICancelLeaseRequest} request CancelLeaseRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.CancelLeaseCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.cancelLease = function cancelLease(request, callback) { - return this.rpcCall(cancelLease, $root.google.cloud.tasks.v2beta2.CancelLeaseRequest, $root.google.cloud.tasks.v2beta2.Task, request, callback); - }, "name", { value: "CancelLease" }); - - /** - * Calls CancelLease. - * @function cancelLease - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.ICancelLeaseRequest} request CancelLeaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta2.CloudTasks|runTask}. - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @typedef RunTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta2.Task} [response] Task - */ - - /** - * Calls RunTask. - * @function runTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IRunTaskRequest} request RunTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta2.CloudTasks.RunTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.runTask = function runTask(request, callback) { - return this.rpcCall(runTask, $root.google.cloud.tasks.v2beta2.RunTaskRequest, $root.google.cloud.tasks.v2beta2.Task, request, callback); - }, "name", { value: "RunTask" }); - - /** - * Calls RunTask. - * @function runTask - * @memberof google.cloud.tasks.v2beta2.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta2.IRunTaskRequest} request RunTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CloudTasks; - })(); - - v2beta2.ListQueuesRequest = (function() { - - /** - * Properties of a ListQueuesRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IListQueuesRequest - * @property {string|null} [parent] ListQueuesRequest parent - * @property {string|null} [filter] ListQueuesRequest filter - * @property {number|null} [pageSize] ListQueuesRequest pageSize - * @property {string|null} [pageToken] ListQueuesRequest pageToken - * @property {google.protobuf.IFieldMask|null} [readMask] ListQueuesRequest readMask - */ - - /** - * Constructs a new ListQueuesRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a ListQueuesRequest. - * @implements IListQueuesRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IListQueuesRequest=} [properties] Properties to set - */ - function ListQueuesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListQueuesRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.parent = ""; - - /** - * ListQueuesRequest filter. - * @member {string} filter - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.filter = ""; - - /** - * ListQueuesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.pageSize = 0; - - /** - * ListQueuesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.pageToken = ""; - - /** - * ListQueuesRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.readMask = null; - - /** - * Creates a new ListQueuesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta2.IListQueuesRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.ListQueuesRequest} ListQueuesRequest instance - */ - ListQueuesRequest.create = function create(properties) { - return new ListQueuesRequest(properties); - }; - - /** - * Encodes the specified ListQueuesRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta2.IListQueuesRequest} message ListQueuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListQueuesRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta2.IListQueuesRequest} message ListQueuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.ListQueuesRequest} ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.ListQueuesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.ListQueuesRequest} ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListQueuesRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListQueuesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } - return null; - }; - - /** - * Creates a ListQueuesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.ListQueuesRequest} ListQueuesRequest - */ - ListQueuesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.ListQueuesRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.ListQueuesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.ListQueuesRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - return message; - }; - - /** - * Creates a plain object from a ListQueuesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta2.ListQueuesRequest} message ListQueuesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListQueuesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.readMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - return object; - }; - - /** - * Converts this ListQueuesRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @instance - * @returns {Object.} JSON object - */ - ListQueuesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListQueuesRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.ListQueuesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListQueuesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.ListQueuesRequest"; - }; - - return ListQueuesRequest; - })(); - - v2beta2.ListQueuesResponse = (function() { - - /** - * Properties of a ListQueuesResponse. - * @memberof google.cloud.tasks.v2beta2 - * @interface IListQueuesResponse - * @property {Array.|null} [queues] ListQueuesResponse queues - * @property {string|null} [nextPageToken] ListQueuesResponse nextPageToken - */ - - /** - * Constructs a new ListQueuesResponse. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a ListQueuesResponse. - * @implements IListQueuesResponse - * @constructor - * @param {google.cloud.tasks.v2beta2.IListQueuesResponse=} [properties] Properties to set - */ - function ListQueuesResponse(properties) { - this.queues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListQueuesResponse queues. - * @member {Array.} queues - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @instance - */ - ListQueuesResponse.prototype.queues = $util.emptyArray; - - /** - * ListQueuesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @instance - */ - ListQueuesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListQueuesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta2.IListQueuesResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.ListQueuesResponse} ListQueuesResponse instance - */ - ListQueuesResponse.create = function create(properties) { - return new ListQueuesResponse(properties); - }; - - /** - * Encodes the specified ListQueuesResponse message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta2.IListQueuesResponse} message ListQueuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queues != null && message.queues.length) - for (var i = 0; i < message.queues.length; ++i) - $root.google.cloud.tasks.v2beta2.Queue.encode(message.queues[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 ListQueuesResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListQueuesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta2.IListQueuesResponse} message ListQueuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.ListQueuesResponse} ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.ListQueuesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.queues && message.queues.length)) - message.queues = []; - message.queues.push($root.google.cloud.tasks.v2beta2.Queue.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.ListQueuesResponse} ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListQueuesResponse message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListQueuesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queues != null && message.hasOwnProperty("queues")) { - if (!Array.isArray(message.queues)) - return "queues: array expected"; - for (var i = 0; i < message.queues.length; ++i) { - var error = $root.google.cloud.tasks.v2beta2.Queue.verify(message.queues[i]); - if (error) - return "queues." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListQueuesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.ListQueuesResponse} ListQueuesResponse - */ - ListQueuesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.ListQueuesResponse) - return object; - var message = new $root.google.cloud.tasks.v2beta2.ListQueuesResponse(); - if (object.queues) { - if (!Array.isArray(object.queues)) - throw TypeError(".google.cloud.tasks.v2beta2.ListQueuesResponse.queues: array expected"); - message.queues = []; - for (var i = 0; i < object.queues.length; ++i) { - if (typeof object.queues[i] !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.ListQueuesResponse.queues: object expected"); - message.queues[i] = $root.google.cloud.tasks.v2beta2.Queue.fromObject(object.queues[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListQueuesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta2.ListQueuesResponse} message ListQueuesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListQueuesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queues = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.queues && message.queues.length) { - object.queues = []; - for (var j = 0; j < message.queues.length; ++j) - object.queues[j] = $root.google.cloud.tasks.v2beta2.Queue.toObject(message.queues[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListQueuesResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @instance - * @returns {Object.} JSON object - */ - ListQueuesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListQueuesResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.ListQueuesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListQueuesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.ListQueuesResponse"; - }; - - return ListQueuesResponse; - })(); - - v2beta2.GetQueueRequest = (function() { - - /** - * Properties of a GetQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IGetQueueRequest - * @property {string|null} [name] GetQueueRequest name - * @property {google.protobuf.IFieldMask|null} [readMask] GetQueueRequest readMask - */ - - /** - * Constructs a new GetQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a GetQueueRequest. - * @implements IGetQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IGetQueueRequest=} [properties] Properties to set - */ - function GetQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @instance - */ - GetQueueRequest.prototype.name = ""; - - /** - * GetQueueRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @instance - */ - GetQueueRequest.prototype.readMask = null; - - /** - * Creates a new GetQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IGetQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.GetQueueRequest} GetQueueRequest instance - */ - GetQueueRequest.create = function create(properties) { - return new GetQueueRequest(properties); - }; - - /** - * Encodes the specified GetQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.GetQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IGetQueueRequest} message GetQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetQueueRequest.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.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.GetQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IGetQueueRequest} message GetQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.GetQueueRequest} GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.GetQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.GetQueueRequest} GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetQueueRequest.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.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } - return null; - }; - - /** - * Creates a GetQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.GetQueueRequest} GetQueueRequest - */ - GetQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.GetQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.GetQueueRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.GetQueueRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - return message; - }; - - /** - * Creates a plain object from a GetQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.GetQueueRequest} message GetQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.readMask = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - return object; - }; - - /** - * Converts this GetQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @instance - * @returns {Object.} JSON object - */ - GetQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.GetQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.GetQueueRequest"; - }; - - return GetQueueRequest; - })(); - - v2beta2.CreateQueueRequest = (function() { - - /** - * Properties of a CreateQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface ICreateQueueRequest - * @property {string|null} [parent] CreateQueueRequest parent - * @property {google.cloud.tasks.v2beta2.IQueue|null} [queue] CreateQueueRequest queue - */ - - /** - * Constructs a new CreateQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a CreateQueueRequest. - * @implements ICreateQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.ICreateQueueRequest=} [properties] Properties to set - */ - function CreateQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateQueueRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @instance - */ - CreateQueueRequest.prototype.parent = ""; - - /** - * CreateQueueRequest queue. - * @member {google.cloud.tasks.v2beta2.IQueue|null|undefined} queue - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @instance - */ - CreateQueueRequest.prototype.queue = null; - - /** - * Creates a new CreateQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICreateQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.CreateQueueRequest} CreateQueueRequest instance - */ - CreateQueueRequest.create = function create(properties) { - return new CreateQueueRequest(properties); - }; - - /** - * Encodes the specified CreateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICreateQueueRequest} message CreateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateQueueRequest.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.queue != null && Object.hasOwnProperty.call(message, "queue")) - $root.google.cloud.tasks.v2beta2.Queue.encode(message.queue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICreateQueueRequest} message CreateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.CreateQueueRequest} CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.CreateQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.queue = $root.google.cloud.tasks.v2beta2.Queue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.CreateQueueRequest} CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateQueueRequest.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.queue != null && message.hasOwnProperty("queue")) { - var error = $root.google.cloud.tasks.v2beta2.Queue.verify(message.queue); - if (error) - return "queue." + error; - } - return null; - }; - - /** - * Creates a CreateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.CreateQueueRequest} CreateQueueRequest - */ - CreateQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.CreateQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.CreateQueueRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.queue != null) { - if (typeof object.queue !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.CreateQueueRequest.queue: object expected"); - message.queue = $root.google.cloud.tasks.v2beta2.Queue.fromObject(object.queue); - } - return message; - }; - - /** - * Creates a plain object from a CreateQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.CreateQueueRequest} message CreateQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.queue = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = $root.google.cloud.tasks.v2beta2.Queue.toObject(message.queue, options); - return object; - }; - - /** - * Converts this CreateQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @instance - * @returns {Object.} JSON object - */ - CreateQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.CreateQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.CreateQueueRequest"; - }; - - return CreateQueueRequest; - })(); - - v2beta2.UpdateQueueRequest = (function() { - - /** - * Properties of an UpdateQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IUpdateQueueRequest - * @property {google.cloud.tasks.v2beta2.IQueue|null} [queue] UpdateQueueRequest queue - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateQueueRequest updateMask - */ - - /** - * Constructs a new UpdateQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents an UpdateQueueRequest. - * @implements IUpdateQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IUpdateQueueRequest=} [properties] Properties to set - */ - function UpdateQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateQueueRequest queue. - * @member {google.cloud.tasks.v2beta2.IQueue|null|undefined} queue - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @instance - */ - UpdateQueueRequest.prototype.queue = null; - - /** - * UpdateQueueRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @instance - */ - UpdateQueueRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IUpdateQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.UpdateQueueRequest} UpdateQueueRequest instance - */ - UpdateQueueRequest.create = function create(properties) { - return new UpdateQueueRequest(properties); - }; - - /** - * Encodes the specified UpdateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.UpdateQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IUpdateQueueRequest} message UpdateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateQueueRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - $root.google.cloud.tasks.v2beta2.Queue.encode(message.queue, 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 UpdateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.UpdateQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IUpdateQueueRequest} message UpdateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.UpdateQueueRequest} UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.UpdateQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.queue = $root.google.cloud.tasks.v2beta2.Queue.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 UpdateQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.UpdateQueueRequest} UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateQueueRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) { - var error = $root.google.cloud.tasks.v2beta2.Queue.verify(message.queue); - if (error) - return "queue." + 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 UpdateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.UpdateQueueRequest} UpdateQueueRequest - */ - UpdateQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.UpdateQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.UpdateQueueRequest(); - if (object.queue != null) { - if (typeof object.queue !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.UpdateQueueRequest.queue: object expected"); - message.queue = $root.google.cloud.tasks.v2beta2.Queue.fromObject(object.queue); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.UpdateQueueRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.UpdateQueueRequest} message UpdateQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = null; - object.updateMask = null; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = $root.google.cloud.tasks.v2beta2.Queue.toObject(message.queue, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.UpdateQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.UpdateQueueRequest"; - }; - - return UpdateQueueRequest; - })(); - - v2beta2.DeleteQueueRequest = (function() { - - /** - * Properties of a DeleteQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IDeleteQueueRequest - * @property {string|null} [name] DeleteQueueRequest name - */ - - /** - * Constructs a new DeleteQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a DeleteQueueRequest. - * @implements IDeleteQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IDeleteQueueRequest=} [properties] Properties to set - */ - function DeleteQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @instance - */ - DeleteQueueRequest.prototype.name = ""; - - /** - * Creates a new DeleteQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IDeleteQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.DeleteQueueRequest} DeleteQueueRequest instance - */ - DeleteQueueRequest.create = function create(properties) { - return new DeleteQueueRequest(properties); - }; - - /** - * Encodes the specified DeleteQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IDeleteQueueRequest} message DeleteQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteQueueRequest.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 DeleteQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IDeleteQueueRequest} message DeleteQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.DeleteQueueRequest} DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.DeleteQueueRequest(); - 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 DeleteQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.DeleteQueueRequest} DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteQueueRequest.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 DeleteQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.DeleteQueueRequest} DeleteQueueRequest - */ - DeleteQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.DeleteQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.DeleteQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.DeleteQueueRequest} message DeleteQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteQueueRequest.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 DeleteQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.DeleteQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.DeleteQueueRequest"; - }; - - return DeleteQueueRequest; - })(); - - v2beta2.PurgeQueueRequest = (function() { - - /** - * Properties of a PurgeQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IPurgeQueueRequest - * @property {string|null} [name] PurgeQueueRequest name - */ - - /** - * Constructs a new PurgeQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a PurgeQueueRequest. - * @implements IPurgeQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IPurgeQueueRequest=} [properties] Properties to set - */ - function PurgeQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PurgeQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @instance - */ - PurgeQueueRequest.prototype.name = ""; - - /** - * Creates a new PurgeQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IPurgeQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.PurgeQueueRequest} PurgeQueueRequest instance - */ - PurgeQueueRequest.create = function create(properties) { - return new PurgeQueueRequest(properties); - }; - - /** - * Encodes the specified PurgeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.PurgeQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IPurgeQueueRequest} message PurgeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeQueueRequest.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 PurgeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PurgeQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IPurgeQueueRequest} message PurgeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.PurgeQueueRequest} PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.PurgeQueueRequest(); - 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 PurgeQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.PurgeQueueRequest} PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PurgeQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurgeQueueRequest.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 PurgeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.PurgeQueueRequest} PurgeQueueRequest - */ - PurgeQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.PurgeQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.PurgeQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PurgeQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.PurgeQueueRequest} message PurgeQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurgeQueueRequest.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 PurgeQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @instance - * @returns {Object.} JSON object - */ - PurgeQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PurgeQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.PurgeQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PurgeQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.PurgeQueueRequest"; - }; - - return PurgeQueueRequest; - })(); - - v2beta2.PauseQueueRequest = (function() { - - /** - * Properties of a PauseQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IPauseQueueRequest - * @property {string|null} [name] PauseQueueRequest name - */ - - /** - * Constructs a new PauseQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a PauseQueueRequest. - * @implements IPauseQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IPauseQueueRequest=} [properties] Properties to set - */ - function PauseQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PauseQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @instance - */ - PauseQueueRequest.prototype.name = ""; - - /** - * Creates a new PauseQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IPauseQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.PauseQueueRequest} PauseQueueRequest instance - */ - PauseQueueRequest.create = function create(properties) { - return new PauseQueueRequest(properties); - }; - - /** - * Encodes the specified PauseQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.PauseQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IPauseQueueRequest} message PauseQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PauseQueueRequest.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 PauseQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PauseQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IPauseQueueRequest} message PauseQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PauseQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.PauseQueueRequest} PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PauseQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.PauseQueueRequest(); - 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 PauseQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.PauseQueueRequest} PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PauseQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PauseQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PauseQueueRequest.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 PauseQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.PauseQueueRequest} PauseQueueRequest - */ - PauseQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.PauseQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.PauseQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PauseQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.PauseQueueRequest} message PauseQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PauseQueueRequest.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 PauseQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @instance - * @returns {Object.} JSON object - */ - PauseQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PauseQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.PauseQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PauseQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.PauseQueueRequest"; - }; - - return PauseQueueRequest; - })(); - - v2beta2.ResumeQueueRequest = (function() { - - /** - * Properties of a ResumeQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IResumeQueueRequest - * @property {string|null} [name] ResumeQueueRequest name - */ - - /** - * Constructs a new ResumeQueueRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a ResumeQueueRequest. - * @implements IResumeQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IResumeQueueRequest=} [properties] Properties to set - */ - function ResumeQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResumeQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @instance - */ - ResumeQueueRequest.prototype.name = ""; - - /** - * Creates a new ResumeQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IResumeQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.ResumeQueueRequest} ResumeQueueRequest instance - */ - ResumeQueueRequest.create = function create(properties) { - return new ResumeQueueRequest(properties); - }; - - /** - * Encodes the specified ResumeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.ResumeQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IResumeQueueRequest} message ResumeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResumeQueueRequest.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 ResumeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ResumeQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.IResumeQueueRequest} message ResumeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResumeQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.ResumeQueueRequest} ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResumeQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.ResumeQueueRequest(); - 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 ResumeQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.ResumeQueueRequest} ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResumeQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResumeQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResumeQueueRequest.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 ResumeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.ResumeQueueRequest} ResumeQueueRequest - */ - ResumeQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.ResumeQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.ResumeQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a ResumeQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta2.ResumeQueueRequest} message ResumeQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResumeQueueRequest.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 ResumeQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @instance - * @returns {Object.} JSON object - */ - ResumeQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResumeQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.ResumeQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResumeQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.ResumeQueueRequest"; - }; - - return ResumeQueueRequest; - })(); - - v2beta2.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] ListTasksRequest responseView - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.responseView = 0; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - case 4: { - message.pageSize = reader.int32(); - break; - } - case 5: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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 ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.ListTasksRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - 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 ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v2beta2.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.tasks.v2beta2 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.tasks.v2beta2.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.tasks.v2beta2.Task.encode(message.tasks[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 ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.tasks.v2beta2.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.tasks.v2beta2.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.ListTasksResponse) - return object; - var message = new $root.google.cloud.tasks.v2beta2.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.tasks.v2beta2.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.tasks.v2beta2.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tasks = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.tasks.v2beta2.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v2beta2.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] GetTaskRequest responseView - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * GetTaskRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.responseView = 0; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.GetTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v2beta2.CreateTaskRequest = (function() { - - /** - * Properties of a CreateTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface ICreateTaskRequest - * @property {string|null} [parent] CreateTaskRequest parent - * @property {google.cloud.tasks.v2beta2.ITask|null} [task] CreateTaskRequest task - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] CreateTaskRequest responseView - */ - - /** - * Constructs a new CreateTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a CreateTaskRequest. - * @implements ICreateTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.ICreateTaskRequest=} [properties] Properties to set - */ - function CreateTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateTaskRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.parent = ""; - - /** - * CreateTaskRequest task. - * @member {google.cloud.tasks.v2beta2.ITask|null|undefined} task - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.task = null; - - /** - * CreateTaskRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.responseView = 0; - - /** - * Creates a new CreateTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICreateTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.CreateTaskRequest} CreateTaskRequest instance - */ - CreateTaskRequest.create = function create(properties) { - return new CreateTaskRequest(properties); - }; - - /** - * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateTaskRequest.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.task != null && Object.hasOwnProperty.call(message, "task")) - $root.google.cloud.tasks.v2beta2.Task.encode(message.task, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.CreateTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.CreateTaskRequest} CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.CreateTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.task = $root.google.cloud.tasks.v2beta2.Task.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.CreateTaskRequest} CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateTaskRequest.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.task != null && message.hasOwnProperty("task")) { - var error = $root.google.cloud.tasks.v2beta2.Task.verify(message.task); - if (error) - return "task." + error; - } - if (message.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.CreateTaskRequest} CreateTaskRequest - */ - CreateTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.CreateTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.CreateTaskRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.task != null) { - if (typeof object.task !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.CreateTaskRequest.task: object expected"); - message.task = $root.google.cloud.tasks.v2beta2.Task.fromObject(object.task); - } - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.CreateTaskRequest} message CreateTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.task = null; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.task != null && message.hasOwnProperty("task")) - object.task = $root.google.cloud.tasks.v2beta2.Task.toObject(message.task, options); - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this CreateTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @instance - * @returns {Object.} JSON object - */ - CreateTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.CreateTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.CreateTaskRequest"; - }; - - return CreateTaskRequest; - })(); - - v2beta2.DeleteTaskRequest = (function() { - - /** - * Properties of a DeleteTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IDeleteTaskRequest - * @property {string|null} [name] DeleteTaskRequest name - */ - - /** - * Constructs a new DeleteTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a DeleteTaskRequest. - * @implements IDeleteTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IDeleteTaskRequest=} [properties] Properties to set - */ - function DeleteTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @instance - */ - DeleteTaskRequest.prototype.name = ""; - - /** - * Creates a new DeleteTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IDeleteTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.DeleteTaskRequest} DeleteTaskRequest instance - */ - DeleteTaskRequest.create = function create(properties) { - return new DeleteTaskRequest(properties); - }; - - /** - * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTaskRequest.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 DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.DeleteTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.DeleteTaskRequest} DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.DeleteTaskRequest(); - 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 DeleteTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.DeleteTaskRequest} DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteTaskRequest.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 DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.DeleteTaskRequest} DeleteTaskRequest - */ - DeleteTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.DeleteTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.DeleteTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.DeleteTaskRequest} message DeleteTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteTaskRequest.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 DeleteTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.DeleteTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.DeleteTaskRequest"; - }; - - return DeleteTaskRequest; - })(); - - v2beta2.LeaseTasksRequest = (function() { - - /** - * Properties of a LeaseTasksRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface ILeaseTasksRequest - * @property {string|null} [parent] LeaseTasksRequest parent - * @property {number|null} [maxTasks] LeaseTasksRequest maxTasks - * @property {google.protobuf.IDuration|null} [leaseDuration] LeaseTasksRequest leaseDuration - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] LeaseTasksRequest responseView - * @property {string|null} [filter] LeaseTasksRequest filter - */ - - /** - * Constructs a new LeaseTasksRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a LeaseTasksRequest. - * @implements ILeaseTasksRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.ILeaseTasksRequest=} [properties] Properties to set - */ - function LeaseTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LeaseTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @instance - */ - LeaseTasksRequest.prototype.parent = ""; - - /** - * LeaseTasksRequest maxTasks. - * @member {number} maxTasks - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @instance - */ - LeaseTasksRequest.prototype.maxTasks = 0; - - /** - * LeaseTasksRequest leaseDuration. - * @member {google.protobuf.IDuration|null|undefined} leaseDuration - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @instance - */ - LeaseTasksRequest.prototype.leaseDuration = null; - - /** - * LeaseTasksRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @instance - */ - LeaseTasksRequest.prototype.responseView = 0; - - /** - * LeaseTasksRequest filter. - * @member {string} filter - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @instance - */ - LeaseTasksRequest.prototype.filter = ""; - - /** - * Creates a new LeaseTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.ILeaseTasksRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.LeaseTasksRequest} LeaseTasksRequest instance - */ - LeaseTasksRequest.create = function create(properties) { - return new LeaseTasksRequest(properties); - }; - - /** - * Encodes the specified LeaseTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.ILeaseTasksRequest} message LeaseTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeaseTasksRequest.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.maxTasks != null && Object.hasOwnProperty.call(message, "maxTasks")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxTasks); - if (message.leaseDuration != null && Object.hasOwnProperty.call(message, "leaseDuration")) - $root.google.protobuf.Duration.encode(message.leaseDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.responseView); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - return writer; - }; - - /** - * Encodes the specified LeaseTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.ILeaseTasksRequest} message LeaseTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeaseTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LeaseTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.LeaseTasksRequest} LeaseTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeaseTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.LeaseTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.maxTasks = reader.int32(); - break; - } - case 3: { - message.leaseDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.responseView = reader.int32(); - break; - } - case 5: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LeaseTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.LeaseTasksRequest} LeaseTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeaseTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LeaseTasksRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LeaseTasksRequest.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.maxTasks != null && message.hasOwnProperty("maxTasks")) - if (!$util.isInteger(message.maxTasks)) - return "maxTasks: integer expected"; - if (message.leaseDuration != null && message.hasOwnProperty("leaseDuration")) { - var error = $root.google.protobuf.Duration.verify(message.leaseDuration); - if (error) - return "leaseDuration." + error; - } - if (message.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a LeaseTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.LeaseTasksRequest} LeaseTasksRequest - */ - LeaseTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.LeaseTasksRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.LeaseTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.maxTasks != null) - message.maxTasks = object.maxTasks | 0; - if (object.leaseDuration != null) { - if (typeof object.leaseDuration !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.LeaseTasksRequest.leaseDuration: object expected"); - message.leaseDuration = $root.google.protobuf.Duration.fromObject(object.leaseDuration); - } - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a LeaseTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {google.cloud.tasks.v2beta2.LeaseTasksRequest} message LeaseTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LeaseTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.maxTasks = 0; - object.leaseDuration = null; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.maxTasks != null && message.hasOwnProperty("maxTasks")) - object.maxTasks = message.maxTasks; - if (message.leaseDuration != null && message.hasOwnProperty("leaseDuration")) - object.leaseDuration = $root.google.protobuf.Duration.toObject(message.leaseDuration, options); - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this LeaseTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @instance - * @returns {Object.} JSON object - */ - LeaseTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LeaseTasksRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.LeaseTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LeaseTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.LeaseTasksRequest"; - }; - - return LeaseTasksRequest; - })(); - - v2beta2.LeaseTasksResponse = (function() { - - /** - * Properties of a LeaseTasksResponse. - * @memberof google.cloud.tasks.v2beta2 - * @interface ILeaseTasksResponse - * @property {Array.|null} [tasks] LeaseTasksResponse tasks - */ - - /** - * Constructs a new LeaseTasksResponse. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a LeaseTasksResponse. - * @implements ILeaseTasksResponse - * @constructor - * @param {google.cloud.tasks.v2beta2.ILeaseTasksResponse=} [properties] Properties to set - */ - function LeaseTasksResponse(properties) { - this.tasks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LeaseTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @instance - */ - LeaseTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * Creates a new LeaseTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.ILeaseTasksResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.LeaseTasksResponse} LeaseTasksResponse instance - */ - LeaseTasksResponse.create = function create(properties) { - return new LeaseTasksResponse(properties); - }; - - /** - * Encodes the specified LeaseTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.ILeaseTasksResponse} message LeaseTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeaseTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.tasks.v2beta2.Task.encode(message.tasks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LeaseTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.LeaseTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.ILeaseTasksResponse} message LeaseTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LeaseTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LeaseTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.LeaseTasksResponse} LeaseTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeaseTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.LeaseTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.tasks.v2beta2.Task.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LeaseTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.LeaseTasksResponse} LeaseTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LeaseTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LeaseTasksResponse message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LeaseTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.tasks.v2beta2.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - return null; - }; - - /** - * Creates a LeaseTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.LeaseTasksResponse} LeaseTasksResponse - */ - LeaseTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.LeaseTasksResponse) - return object; - var message = new $root.google.cloud.tasks.v2beta2.LeaseTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.tasks.v2beta2.LeaseTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.LeaseTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.tasks.v2beta2.Task.fromObject(object.tasks[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a LeaseTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {google.cloud.tasks.v2beta2.LeaseTasksResponse} message LeaseTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LeaseTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tasks = []; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.tasks.v2beta2.Task.toObject(message.tasks[j], options); - } - return object; - }; - - /** - * Converts this LeaseTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @instance - * @returns {Object.} JSON object - */ - LeaseTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LeaseTasksResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.LeaseTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LeaseTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.LeaseTasksResponse"; - }; - - return LeaseTasksResponse; - })(); - - v2beta2.AcknowledgeTaskRequest = (function() { - - /** - * Properties of an AcknowledgeTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IAcknowledgeTaskRequest - * @property {string|null} [name] AcknowledgeTaskRequest name - * @property {google.protobuf.ITimestamp|null} [scheduleTime] AcknowledgeTaskRequest scheduleTime - */ - - /** - * Constructs a new AcknowledgeTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents an AcknowledgeTaskRequest. - * @implements IAcknowledgeTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest=} [properties] Properties to set - */ - function AcknowledgeTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AcknowledgeTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @instance - */ - AcknowledgeTaskRequest.prototype.name = ""; - - /** - * AcknowledgeTaskRequest scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @instance - */ - AcknowledgeTaskRequest.prototype.scheduleTime = null; - - /** - * Creates a new AcknowledgeTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.AcknowledgeTaskRequest} AcknowledgeTaskRequest instance - */ - AcknowledgeTaskRequest.create = function create(properties) { - return new AcknowledgeTaskRequest(properties); - }; - - /** - * Encodes the specified AcknowledgeTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest} message AcknowledgeTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcknowledgeTaskRequest.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.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AcknowledgeTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest} message AcknowledgeTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcknowledgeTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AcknowledgeTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.AcknowledgeTaskRequest} AcknowledgeTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcknowledgeTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AcknowledgeTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.AcknowledgeTaskRequest} AcknowledgeTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcknowledgeTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AcknowledgeTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AcknowledgeTaskRequest.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.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - return null; - }; - - /** - * Creates an AcknowledgeTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.AcknowledgeTaskRequest} AcknowledgeTaskRequest - */ - AcknowledgeTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AcknowledgeTaskRequest.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - return message; - }; - - /** - * Creates a plain object from an AcknowledgeTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.AcknowledgeTaskRequest} message AcknowledgeTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AcknowledgeTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.scheduleTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - return object; - }; - - /** - * Converts this AcknowledgeTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @instance - * @returns {Object.} JSON object - */ - AcknowledgeTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AcknowledgeTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.AcknowledgeTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AcknowledgeTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.AcknowledgeTaskRequest"; - }; - - return AcknowledgeTaskRequest; - })(); - - v2beta2.RenewLeaseRequest = (function() { - - /** - * Properties of a RenewLeaseRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IRenewLeaseRequest - * @property {string|null} [name] RenewLeaseRequest name - * @property {google.protobuf.ITimestamp|null} [scheduleTime] RenewLeaseRequest scheduleTime - * @property {google.protobuf.IDuration|null} [leaseDuration] RenewLeaseRequest leaseDuration - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] RenewLeaseRequest responseView - */ - - /** - * Constructs a new RenewLeaseRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a RenewLeaseRequest. - * @implements IRenewLeaseRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IRenewLeaseRequest=} [properties] Properties to set - */ - function RenewLeaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RenewLeaseRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @instance - */ - RenewLeaseRequest.prototype.name = ""; - - /** - * RenewLeaseRequest scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @instance - */ - RenewLeaseRequest.prototype.scheduleTime = null; - - /** - * RenewLeaseRequest leaseDuration. - * @member {google.protobuf.IDuration|null|undefined} leaseDuration - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @instance - */ - RenewLeaseRequest.prototype.leaseDuration = null; - - /** - * RenewLeaseRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @instance - */ - RenewLeaseRequest.prototype.responseView = 0; - - /** - * Creates a new RenewLeaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.IRenewLeaseRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.RenewLeaseRequest} RenewLeaseRequest instance - */ - RenewLeaseRequest.create = function create(properties) { - return new RenewLeaseRequest(properties); - }; - - /** - * Encodes the specified RenewLeaseRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.RenewLeaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.IRenewLeaseRequest} message RenewLeaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RenewLeaseRequest.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.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.leaseDuration != null && Object.hasOwnProperty.call(message, "leaseDuration")) - $root.google.protobuf.Duration.encode(message.leaseDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified RenewLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RenewLeaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.IRenewLeaseRequest} message RenewLeaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RenewLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RenewLeaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.RenewLeaseRequest} RenewLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RenewLeaseRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.RenewLeaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.leaseDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RenewLeaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.RenewLeaseRequest} RenewLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RenewLeaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RenewLeaseRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RenewLeaseRequest.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.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.leaseDuration != null && message.hasOwnProperty("leaseDuration")) { - var error = $root.google.protobuf.Duration.verify(message.leaseDuration); - if (error) - return "leaseDuration." + error; - } - if (message.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a RenewLeaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.RenewLeaseRequest} RenewLeaseRequest - */ - RenewLeaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.RenewLeaseRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.RenewLeaseRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.RenewLeaseRequest.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.leaseDuration != null) { - if (typeof object.leaseDuration !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.RenewLeaseRequest.leaseDuration: object expected"); - message.leaseDuration = $root.google.protobuf.Duration.fromObject(object.leaseDuration); - } - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a RenewLeaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.RenewLeaseRequest} message RenewLeaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RenewLeaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.scheduleTime = null; - object.leaseDuration = null; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.leaseDuration != null && message.hasOwnProperty("leaseDuration")) - object.leaseDuration = $root.google.protobuf.Duration.toObject(message.leaseDuration, options); - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this RenewLeaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @instance - * @returns {Object.} JSON object - */ - RenewLeaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RenewLeaseRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.RenewLeaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RenewLeaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.RenewLeaseRequest"; - }; - - return RenewLeaseRequest; - })(); - - v2beta2.CancelLeaseRequest = (function() { - - /** - * Properties of a CancelLeaseRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface ICancelLeaseRequest - * @property {string|null} [name] CancelLeaseRequest name - * @property {google.protobuf.ITimestamp|null} [scheduleTime] CancelLeaseRequest scheduleTime - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] CancelLeaseRequest responseView - */ - - /** - * Constructs a new CancelLeaseRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a CancelLeaseRequest. - * @implements ICancelLeaseRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.ICancelLeaseRequest=} [properties] Properties to set - */ - function CancelLeaseRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelLeaseRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @instance - */ - CancelLeaseRequest.prototype.name = ""; - - /** - * CancelLeaseRequest scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @instance - */ - CancelLeaseRequest.prototype.scheduleTime = null; - - /** - * CancelLeaseRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @instance - */ - CancelLeaseRequest.prototype.responseView = 0; - - /** - * Creates a new CancelLeaseRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICancelLeaseRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.CancelLeaseRequest} CancelLeaseRequest instance - */ - CancelLeaseRequest.create = function create(properties) { - return new CancelLeaseRequest(properties); - }; - - /** - * Encodes the specified CancelLeaseRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.CancelLeaseRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICancelLeaseRequest} message CancelLeaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelLeaseRequest.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.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified CancelLeaseRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.CancelLeaseRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.ICancelLeaseRequest} message CancelLeaseRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelLeaseRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelLeaseRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.CancelLeaseRequest} CancelLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelLeaseRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.CancelLeaseRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelLeaseRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.CancelLeaseRequest} CancelLeaseRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelLeaseRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelLeaseRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelLeaseRequest.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.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CancelLeaseRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.CancelLeaseRequest} CancelLeaseRequest - */ - CancelLeaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.CancelLeaseRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.CancelLeaseRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.CancelLeaseRequest.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CancelLeaseRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {google.cloud.tasks.v2beta2.CancelLeaseRequest} message CancelLeaseRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelLeaseRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.scheduleTime = null; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this CancelLeaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @instance - * @returns {Object.} JSON object - */ - CancelLeaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelLeaseRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.CancelLeaseRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelLeaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.CancelLeaseRequest"; - }; - - return CancelLeaseRequest; - })(); - - v2beta2.RunTaskRequest = (function() { - - /** - * Properties of a RunTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IRunTaskRequest - * @property {string|null} [name] RunTaskRequest name - * @property {google.cloud.tasks.v2beta2.Task.View|null} [responseView] RunTaskRequest responseView - */ - - /** - * Constructs a new RunTaskRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a RunTaskRequest. - * @implements IRunTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IRunTaskRequest=} [properties] Properties to set - */ - function RunTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @instance - */ - RunTaskRequest.prototype.name = ""; - - /** - * RunTaskRequest responseView. - * @member {google.cloud.tasks.v2beta2.Task.View} responseView - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @instance - */ - RunTaskRequest.prototype.responseView = 0; - - /** - * Creates a new RunTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IRunTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.RunTaskRequest} RunTaskRequest instance - */ - RunTaskRequest.create = function create(properties) { - return new RunTaskRequest(properties); - }; - - /** - * Encodes the specified RunTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.RunTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IRunTaskRequest} message RunTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunTaskRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified RunTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RunTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.IRunTaskRequest} message RunTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.RunTaskRequest} RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.RunTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.RunTaskRequest} RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunTaskRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a RunTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.RunTaskRequest} RunTaskRequest - */ - RunTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.RunTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.RunTaskRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a RunTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta2.RunTaskRequest} message RunTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta2.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this RunTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @instance - * @returns {Object.} JSON object - */ - RunTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.RunTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.RunTaskRequest"; - }; - - return RunTaskRequest; - })(); - - v2beta2.Queue = (function() { - - /** - * Properties of a Queue. - * @memberof google.cloud.tasks.v2beta2 - * @interface IQueue - * @property {string|null} [name] Queue name - * @property {google.cloud.tasks.v2beta2.IAppEngineHttpTarget|null} [appEngineHttpTarget] Queue appEngineHttpTarget - * @property {google.cloud.tasks.v2beta2.IPullTarget|null} [pullTarget] Queue pullTarget - * @property {google.cloud.tasks.v2beta2.IRateLimits|null} [rateLimits] Queue rateLimits - * @property {google.cloud.tasks.v2beta2.IRetryConfig|null} [retryConfig] Queue retryConfig - * @property {google.cloud.tasks.v2beta2.Queue.State|null} [state] Queue state - * @property {google.protobuf.ITimestamp|null} [purgeTime] Queue purgeTime - * @property {google.protobuf.IDuration|null} [taskTtl] Queue taskTtl - * @property {google.protobuf.IDuration|null} [tombstoneTtl] Queue tombstoneTtl - * @property {google.cloud.tasks.v2beta2.IQueueStats|null} [stats] Queue stats - */ - - /** - * Constructs a new Queue. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a Queue. - * @implements IQueue - * @constructor - * @param {google.cloud.tasks.v2beta2.IQueue=} [properties] Properties to set - */ - function Queue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Queue name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.name = ""; - - /** - * Queue appEngineHttpTarget. - * @member {google.cloud.tasks.v2beta2.IAppEngineHttpTarget|null|undefined} appEngineHttpTarget - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.appEngineHttpTarget = null; - - /** - * Queue pullTarget. - * @member {google.cloud.tasks.v2beta2.IPullTarget|null|undefined} pullTarget - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.pullTarget = null; - - /** - * Queue rateLimits. - * @member {google.cloud.tasks.v2beta2.IRateLimits|null|undefined} rateLimits - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.rateLimits = null; - - /** - * Queue retryConfig. - * @member {google.cloud.tasks.v2beta2.IRetryConfig|null|undefined} retryConfig - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.retryConfig = null; - - /** - * Queue state. - * @member {google.cloud.tasks.v2beta2.Queue.State} state - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.state = 0; - - /** - * Queue purgeTime. - * @member {google.protobuf.ITimestamp|null|undefined} purgeTime - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.purgeTime = null; - - /** - * Queue taskTtl. - * @member {google.protobuf.IDuration|null|undefined} taskTtl - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.taskTtl = null; - - /** - * Queue tombstoneTtl. - * @member {google.protobuf.IDuration|null|undefined} tombstoneTtl - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.tombstoneTtl = null; - - /** - * Queue stats. - * @member {google.cloud.tasks.v2beta2.IQueueStats|null|undefined} stats - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Queue.prototype.stats = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Queue targetType. - * @member {"appEngineHttpTarget"|"pullTarget"|undefined} targetType - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - */ - Object.defineProperty(Queue.prototype, "targetType", { - get: $util.oneOfGetter($oneOfFields = ["appEngineHttpTarget", "pullTarget"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Queue instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {google.cloud.tasks.v2beta2.IQueue=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.Queue} Queue instance - */ - Queue.create = function create(properties) { - return new Queue(properties); - }; - - /** - * Encodes the specified Queue message. Does not implicitly {@link google.cloud.tasks.v2beta2.Queue.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {google.cloud.tasks.v2beta2.IQueue} message Queue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Queue.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.appEngineHttpTarget != null && Object.hasOwnProperty.call(message, "appEngineHttpTarget")) - $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget.encode(message.appEngineHttpTarget, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pullTarget != null && Object.hasOwnProperty.call(message, "pullTarget")) - $root.google.cloud.tasks.v2beta2.PullTarget.encode(message.pullTarget, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rateLimits != null && Object.hasOwnProperty.call(message, "rateLimits")) - $root.google.cloud.tasks.v2beta2.RateLimits.encode(message.rateLimits, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.retryConfig != null && Object.hasOwnProperty.call(message, "retryConfig")) - $root.google.cloud.tasks.v2beta2.RetryConfig.encode(message.retryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.purgeTime != null && Object.hasOwnProperty.call(message, "purgeTime")) - $root.google.protobuf.Timestamp.encode(message.purgeTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.taskTtl != null && Object.hasOwnProperty.call(message, "taskTtl")) - $root.google.protobuf.Duration.encode(message.taskTtl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.tombstoneTtl != null && Object.hasOwnProperty.call(message, "tombstoneTtl")) - $root.google.protobuf.Duration.encode(message.tombstoneTtl, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.cloud.tasks.v2beta2.QueueStats.encode(message.stats, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Queue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.Queue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {google.cloud.tasks.v2beta2.IQueue} message Queue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Queue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Queue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.Queue} Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Queue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.Queue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.appEngineHttpTarget = $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pullTarget = $root.google.cloud.tasks.v2beta2.PullTarget.decode(reader, reader.uint32()); - break; - } - case 5: { - message.rateLimits = $root.google.cloud.tasks.v2beta2.RateLimits.decode(reader, reader.uint32()); - break; - } - case 6: { - message.retryConfig = $root.google.cloud.tasks.v2beta2.RetryConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.purgeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.taskTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 10: { - message.tombstoneTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 16: { - message.stats = $root.google.cloud.tasks.v2beta2.QueueStats.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Queue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.Queue} Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Queue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Queue message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Queue.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.appEngineHttpTarget != null && message.hasOwnProperty("appEngineHttpTarget")) { - properties.targetType = 1; - { - var error = $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget.verify(message.appEngineHttpTarget); - if (error) - return "appEngineHttpTarget." + error; - } - } - if (message.pullTarget != null && message.hasOwnProperty("pullTarget")) { - if (properties.targetType === 1) - return "targetType: multiple values"; - properties.targetType = 1; - { - var error = $root.google.cloud.tasks.v2beta2.PullTarget.verify(message.pullTarget); - if (error) - return "pullTarget." + error; - } - } - if (message.rateLimits != null && message.hasOwnProperty("rateLimits")) { - var error = $root.google.cloud.tasks.v2beta2.RateLimits.verify(message.rateLimits); - if (error) - return "rateLimits." + error; - } - if (message.retryConfig != null && message.hasOwnProperty("retryConfig")) { - var error = $root.google.cloud.tasks.v2beta2.RetryConfig.verify(message.retryConfig); - if (error) - return "retryConfig." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.purgeTime != null && message.hasOwnProperty("purgeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.purgeTime); - if (error) - return "purgeTime." + error; - } - if (message.taskTtl != null && message.hasOwnProperty("taskTtl")) { - var error = $root.google.protobuf.Duration.verify(message.taskTtl); - if (error) - return "taskTtl." + error; - } - if (message.tombstoneTtl != null && message.hasOwnProperty("tombstoneTtl")) { - var error = $root.google.protobuf.Duration.verify(message.tombstoneTtl); - if (error) - return "tombstoneTtl." + error; - } - if (message.stats != null && message.hasOwnProperty("stats")) { - var error = $root.google.cloud.tasks.v2beta2.QueueStats.verify(message.stats); - if (error) - return "stats." + error; - } - return null; - }; - - /** - * Creates a Queue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.Queue} Queue - */ - Queue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.Queue) - return object; - var message = new $root.google.cloud.tasks.v2beta2.Queue(); - if (object.name != null) - message.name = String(object.name); - if (object.appEngineHttpTarget != null) { - if (typeof object.appEngineHttpTarget !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.appEngineHttpTarget: object expected"); - message.appEngineHttpTarget = $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget.fromObject(object.appEngineHttpTarget); - } - if (object.pullTarget != null) { - if (typeof object.pullTarget !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.pullTarget: object expected"); - message.pullTarget = $root.google.cloud.tasks.v2beta2.PullTarget.fromObject(object.pullTarget); - } - if (object.rateLimits != null) { - if (typeof object.rateLimits !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.rateLimits: object expected"); - message.rateLimits = $root.google.cloud.tasks.v2beta2.RateLimits.fromObject(object.rateLimits); - } - if (object.retryConfig != null) { - if (typeof object.retryConfig !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.retryConfig: object expected"); - message.retryConfig = $root.google.cloud.tasks.v2beta2.RetryConfig.fromObject(object.retryConfig); - } - 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 "RUNNING": - case 1: - message.state = 1; - break; - case "PAUSED": - case 2: - message.state = 2; - break; - case "DISABLED": - case 3: - message.state = 3; - break; - } - if (object.purgeTime != null) { - if (typeof object.purgeTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.purgeTime: object expected"); - message.purgeTime = $root.google.protobuf.Timestamp.fromObject(object.purgeTime); - } - if (object.taskTtl != null) { - if (typeof object.taskTtl !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.taskTtl: object expected"); - message.taskTtl = $root.google.protobuf.Duration.fromObject(object.taskTtl); - } - if (object.tombstoneTtl != null) { - if (typeof object.tombstoneTtl !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.tombstoneTtl: object expected"); - message.tombstoneTtl = $root.google.protobuf.Duration.fromObject(object.tombstoneTtl); - } - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Queue.stats: object expected"); - message.stats = $root.google.cloud.tasks.v2beta2.QueueStats.fromObject(object.stats); - } - return message; - }; - - /** - * Creates a plain object from a Queue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {google.cloud.tasks.v2beta2.Queue} message Queue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Queue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.rateLimits = null; - object.retryConfig = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.purgeTime = null; - object.taskTtl = null; - object.tombstoneTtl = null; - object.stats = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appEngineHttpTarget != null && message.hasOwnProperty("appEngineHttpTarget")) { - object.appEngineHttpTarget = $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget.toObject(message.appEngineHttpTarget, options); - if (options.oneofs) - object.targetType = "appEngineHttpTarget"; - } - if (message.pullTarget != null && message.hasOwnProperty("pullTarget")) { - object.pullTarget = $root.google.cloud.tasks.v2beta2.PullTarget.toObject(message.pullTarget, options); - if (options.oneofs) - object.targetType = "pullTarget"; - } - if (message.rateLimits != null && message.hasOwnProperty("rateLimits")) - object.rateLimits = $root.google.cloud.tasks.v2beta2.RateLimits.toObject(message.rateLimits, options); - if (message.retryConfig != null && message.hasOwnProperty("retryConfig")) - object.retryConfig = $root.google.cloud.tasks.v2beta2.RetryConfig.toObject(message.retryConfig, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.tasks.v2beta2.Queue.State[message.state] === undefined ? message.state : $root.google.cloud.tasks.v2beta2.Queue.State[message.state] : message.state; - if (message.purgeTime != null && message.hasOwnProperty("purgeTime")) - object.purgeTime = $root.google.protobuf.Timestamp.toObject(message.purgeTime, options); - if (message.taskTtl != null && message.hasOwnProperty("taskTtl")) - object.taskTtl = $root.google.protobuf.Duration.toObject(message.taskTtl, options); - if (message.tombstoneTtl != null && message.hasOwnProperty("tombstoneTtl")) - object.tombstoneTtl = $root.google.protobuf.Duration.toObject(message.tombstoneTtl, options); - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.cloud.tasks.v2beta2.QueueStats.toObject(message.stats, options); - return object; - }; - - /** - * Converts this Queue to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.Queue - * @instance - * @returns {Object.} JSON object - */ - Queue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Queue - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.Queue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Queue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.Queue"; - }; - - /** - * State enum. - * @name google.cloud.tasks.v2beta2.Queue.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} PAUSED=2 PAUSED value - * @property {number} DISABLED=3 DISABLED value - */ - Queue.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "DISABLED"] = 3; - return values; - })(); - - return Queue; - })(); - - v2beta2.RateLimits = (function() { - - /** - * Properties of a RateLimits. - * @memberof google.cloud.tasks.v2beta2 - * @interface IRateLimits - * @property {number|null} [maxTasksDispatchedPerSecond] RateLimits maxTasksDispatchedPerSecond - * @property {number|null} [maxBurstSize] RateLimits maxBurstSize - * @property {number|null} [maxConcurrentTasks] RateLimits maxConcurrentTasks - */ - - /** - * Constructs a new RateLimits. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a RateLimits. - * @implements IRateLimits - * @constructor - * @param {google.cloud.tasks.v2beta2.IRateLimits=} [properties] Properties to set - */ - function RateLimits(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RateLimits maxTasksDispatchedPerSecond. - * @member {number} maxTasksDispatchedPerSecond - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @instance - */ - RateLimits.prototype.maxTasksDispatchedPerSecond = 0; - - /** - * RateLimits maxBurstSize. - * @member {number} maxBurstSize - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @instance - */ - RateLimits.prototype.maxBurstSize = 0; - - /** - * RateLimits maxConcurrentTasks. - * @member {number} maxConcurrentTasks - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @instance - */ - RateLimits.prototype.maxConcurrentTasks = 0; - - /** - * Creates a new RateLimits instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {google.cloud.tasks.v2beta2.IRateLimits=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.RateLimits} RateLimits instance - */ - RateLimits.create = function create(properties) { - return new RateLimits(properties); - }; - - /** - * Encodes the specified RateLimits message. Does not implicitly {@link google.cloud.tasks.v2beta2.RateLimits.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {google.cloud.tasks.v2beta2.IRateLimits} message RateLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateLimits.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxTasksDispatchedPerSecond != null && Object.hasOwnProperty.call(message, "maxTasksDispatchedPerSecond")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.maxTasksDispatchedPerSecond); - if (message.maxBurstSize != null && Object.hasOwnProperty.call(message, "maxBurstSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxBurstSize); - if (message.maxConcurrentTasks != null && Object.hasOwnProperty.call(message, "maxConcurrentTasks")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxConcurrentTasks); - return writer; - }; - - /** - * Encodes the specified RateLimits message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RateLimits.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {google.cloud.tasks.v2beta2.IRateLimits} message RateLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateLimits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RateLimits message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.RateLimits} RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateLimits.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.RateLimits(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxTasksDispatchedPerSecond = reader.double(); - break; - } - case 2: { - message.maxBurstSize = reader.int32(); - break; - } - case 3: { - message.maxConcurrentTasks = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RateLimits message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.RateLimits} RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateLimits.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RateLimits message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RateLimits.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxTasksDispatchedPerSecond != null && message.hasOwnProperty("maxTasksDispatchedPerSecond")) - if (typeof message.maxTasksDispatchedPerSecond !== "number") - return "maxTasksDispatchedPerSecond: number expected"; - if (message.maxBurstSize != null && message.hasOwnProperty("maxBurstSize")) - if (!$util.isInteger(message.maxBurstSize)) - return "maxBurstSize: integer expected"; - if (message.maxConcurrentTasks != null && message.hasOwnProperty("maxConcurrentTasks")) - if (!$util.isInteger(message.maxConcurrentTasks)) - return "maxConcurrentTasks: integer expected"; - return null; - }; - - /** - * Creates a RateLimits message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.RateLimits} RateLimits - */ - RateLimits.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.RateLimits) - return object; - var message = new $root.google.cloud.tasks.v2beta2.RateLimits(); - if (object.maxTasksDispatchedPerSecond != null) - message.maxTasksDispatchedPerSecond = Number(object.maxTasksDispatchedPerSecond); - if (object.maxBurstSize != null) - message.maxBurstSize = object.maxBurstSize | 0; - if (object.maxConcurrentTasks != null) - message.maxConcurrentTasks = object.maxConcurrentTasks | 0; - return message; - }; - - /** - * Creates a plain object from a RateLimits message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {google.cloud.tasks.v2beta2.RateLimits} message RateLimits - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RateLimits.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxTasksDispatchedPerSecond = 0; - object.maxBurstSize = 0; - object.maxConcurrentTasks = 0; - } - if (message.maxTasksDispatchedPerSecond != null && message.hasOwnProperty("maxTasksDispatchedPerSecond")) - object.maxTasksDispatchedPerSecond = options.json && !isFinite(message.maxTasksDispatchedPerSecond) ? String(message.maxTasksDispatchedPerSecond) : message.maxTasksDispatchedPerSecond; - if (message.maxBurstSize != null && message.hasOwnProperty("maxBurstSize")) - object.maxBurstSize = message.maxBurstSize; - if (message.maxConcurrentTasks != null && message.hasOwnProperty("maxConcurrentTasks")) - object.maxConcurrentTasks = message.maxConcurrentTasks; - return object; - }; - - /** - * Converts this RateLimits to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @instance - * @returns {Object.} JSON object - */ - RateLimits.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RateLimits - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.RateLimits - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RateLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.RateLimits"; - }; - - return RateLimits; - })(); - - v2beta2.RetryConfig = (function() { - - /** - * Properties of a RetryConfig. - * @memberof google.cloud.tasks.v2beta2 - * @interface IRetryConfig - * @property {number|null} [maxAttempts] RetryConfig maxAttempts - * @property {boolean|null} [unlimitedAttempts] RetryConfig unlimitedAttempts - * @property {google.protobuf.IDuration|null} [maxRetryDuration] RetryConfig maxRetryDuration - * @property {google.protobuf.IDuration|null} [minBackoff] RetryConfig minBackoff - * @property {google.protobuf.IDuration|null} [maxBackoff] RetryConfig maxBackoff - * @property {number|null} [maxDoublings] RetryConfig maxDoublings - */ - - /** - * Constructs a new RetryConfig. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a RetryConfig. - * @implements IRetryConfig - * @constructor - * @param {google.cloud.tasks.v2beta2.IRetryConfig=} [properties] Properties to set - */ - function RetryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetryConfig maxAttempts. - * @member {number|null|undefined} maxAttempts - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxAttempts = null; - - /** - * RetryConfig unlimitedAttempts. - * @member {boolean|null|undefined} unlimitedAttempts - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - RetryConfig.prototype.unlimitedAttempts = null; - - /** - * RetryConfig maxRetryDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRetryDuration - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxRetryDuration = null; - - /** - * RetryConfig minBackoff. - * @member {google.protobuf.IDuration|null|undefined} minBackoff - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - RetryConfig.prototype.minBackoff = null; - - /** - * RetryConfig maxBackoff. - * @member {google.protobuf.IDuration|null|undefined} maxBackoff - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxBackoff = null; - - /** - * RetryConfig maxDoublings. - * @member {number} maxDoublings - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - RetryConfig.prototype.maxDoublings = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RetryConfig numAttempts. - * @member {"maxAttempts"|"unlimitedAttempts"|undefined} numAttempts - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - */ - Object.defineProperty(RetryConfig.prototype, "numAttempts", { - get: $util.oneOfGetter($oneOfFields = ["maxAttempts", "unlimitedAttempts"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RetryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta2.IRetryConfig=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.RetryConfig} RetryConfig instance - */ - RetryConfig.create = function create(properties) { - return new RetryConfig(properties); - }; - - /** - * Encodes the specified RetryConfig message. Does not implicitly {@link google.cloud.tasks.v2beta2.RetryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta2.IRetryConfig} message RetryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxAttempts != null && Object.hasOwnProperty.call(message, "maxAttempts")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxAttempts); - if (message.unlimitedAttempts != null && Object.hasOwnProperty.call(message, "unlimitedAttempts")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.unlimitedAttempts); - if (message.maxRetryDuration != null && Object.hasOwnProperty.call(message, "maxRetryDuration")) - $root.google.protobuf.Duration.encode(message.maxRetryDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.minBackoff != null && Object.hasOwnProperty.call(message, "minBackoff")) - $root.google.protobuf.Duration.encode(message.minBackoff, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxBackoff != null && Object.hasOwnProperty.call(message, "maxBackoff")) - $root.google.protobuf.Duration.encode(message.maxBackoff, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.maxDoublings != null && Object.hasOwnProperty.call(message, "maxDoublings")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.maxDoublings); - return writer; - }; - - /** - * Encodes the specified RetryConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.RetryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta2.IRetryConfig} message RetryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.RetryConfig} RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.RetryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxAttempts = reader.int32(); - break; - } - case 2: { - message.unlimitedAttempts = reader.bool(); - break; - } - case 3: { - message.maxRetryDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.minBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.maxDoublings = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.RetryConfig} RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetryConfig message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.maxAttempts != null && message.hasOwnProperty("maxAttempts")) { - properties.numAttempts = 1; - if (!$util.isInteger(message.maxAttempts)) - return "maxAttempts: integer expected"; - } - if (message.unlimitedAttempts != null && message.hasOwnProperty("unlimitedAttempts")) { - if (properties.numAttempts === 1) - return "numAttempts: multiple values"; - properties.numAttempts = 1; - if (typeof message.unlimitedAttempts !== "boolean") - return "unlimitedAttempts: boolean expected"; - } - if (message.maxRetryDuration != null && message.hasOwnProperty("maxRetryDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRetryDuration); - if (error) - return "maxRetryDuration." + error; - } - if (message.minBackoff != null && message.hasOwnProperty("minBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.minBackoff); - if (error) - return "minBackoff." + error; - } - if (message.maxBackoff != null && message.hasOwnProperty("maxBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.maxBackoff); - if (error) - return "maxBackoff." + error; - } - if (message.maxDoublings != null && message.hasOwnProperty("maxDoublings")) - if (!$util.isInteger(message.maxDoublings)) - return "maxDoublings: integer expected"; - return null; - }; - - /** - * Creates a RetryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.RetryConfig} RetryConfig - */ - RetryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.RetryConfig) - return object; - var message = new $root.google.cloud.tasks.v2beta2.RetryConfig(); - if (object.maxAttempts != null) - message.maxAttempts = object.maxAttempts | 0; - if (object.unlimitedAttempts != null) - message.unlimitedAttempts = Boolean(object.unlimitedAttempts); - if (object.maxRetryDuration != null) { - if (typeof object.maxRetryDuration !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.RetryConfig.maxRetryDuration: object expected"); - message.maxRetryDuration = $root.google.protobuf.Duration.fromObject(object.maxRetryDuration); - } - if (object.minBackoff != null) { - if (typeof object.minBackoff !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.RetryConfig.minBackoff: object expected"); - message.minBackoff = $root.google.protobuf.Duration.fromObject(object.minBackoff); - } - if (object.maxBackoff != null) { - if (typeof object.maxBackoff !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.RetryConfig.maxBackoff: object expected"); - message.maxBackoff = $root.google.protobuf.Duration.fromObject(object.maxBackoff); - } - if (object.maxDoublings != null) - message.maxDoublings = object.maxDoublings | 0; - return message; - }; - - /** - * Creates a plain object from a RetryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta2.RetryConfig} message RetryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxRetryDuration = null; - object.minBackoff = null; - object.maxBackoff = null; - object.maxDoublings = 0; - } - if (message.maxAttempts != null && message.hasOwnProperty("maxAttempts")) { - object.maxAttempts = message.maxAttempts; - if (options.oneofs) - object.numAttempts = "maxAttempts"; - } - if (message.unlimitedAttempts != null && message.hasOwnProperty("unlimitedAttempts")) { - object.unlimitedAttempts = message.unlimitedAttempts; - if (options.oneofs) - object.numAttempts = "unlimitedAttempts"; - } - if (message.maxRetryDuration != null && message.hasOwnProperty("maxRetryDuration")) - object.maxRetryDuration = $root.google.protobuf.Duration.toObject(message.maxRetryDuration, options); - if (message.minBackoff != null && message.hasOwnProperty("minBackoff")) - object.minBackoff = $root.google.protobuf.Duration.toObject(message.minBackoff, options); - if (message.maxBackoff != null && message.hasOwnProperty("maxBackoff")) - object.maxBackoff = $root.google.protobuf.Duration.toObject(message.maxBackoff, options); - if (message.maxDoublings != null && message.hasOwnProperty("maxDoublings")) - object.maxDoublings = message.maxDoublings; - return object; - }; - - /** - * Converts this RetryConfig to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @instance - * @returns {Object.} JSON object - */ - RetryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetryConfig - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.RetryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.RetryConfig"; - }; - - return RetryConfig; - })(); - - v2beta2.QueueStats = (function() { - - /** - * Properties of a QueueStats. - * @memberof google.cloud.tasks.v2beta2 - * @interface IQueueStats - * @property {number|Long|null} [tasksCount] QueueStats tasksCount - * @property {google.protobuf.ITimestamp|null} [oldestEstimatedArrivalTime] QueueStats oldestEstimatedArrivalTime - * @property {number|Long|null} [executedLastMinuteCount] QueueStats executedLastMinuteCount - * @property {number|Long|null} [concurrentDispatchesCount] QueueStats concurrentDispatchesCount - * @property {number|null} [effectiveExecutionRate] QueueStats effectiveExecutionRate - */ - - /** - * Constructs a new QueueStats. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a QueueStats. - * @implements IQueueStats - * @constructor - * @param {google.cloud.tasks.v2beta2.IQueueStats=} [properties] Properties to set - */ - function QueueStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueueStats tasksCount. - * @member {number|Long} tasksCount - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @instance - */ - QueueStats.prototype.tasksCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueueStats oldestEstimatedArrivalTime. - * @member {google.protobuf.ITimestamp|null|undefined} oldestEstimatedArrivalTime - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @instance - */ - QueueStats.prototype.oldestEstimatedArrivalTime = null; - - /** - * QueueStats executedLastMinuteCount. - * @member {number|Long} executedLastMinuteCount - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @instance - */ - QueueStats.prototype.executedLastMinuteCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueueStats concurrentDispatchesCount. - * @member {number|Long} concurrentDispatchesCount - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @instance - */ - QueueStats.prototype.concurrentDispatchesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueueStats effectiveExecutionRate. - * @member {number} effectiveExecutionRate - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @instance - */ - QueueStats.prototype.effectiveExecutionRate = 0; - - /** - * Creates a new QueueStats instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {google.cloud.tasks.v2beta2.IQueueStats=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.QueueStats} QueueStats instance - */ - QueueStats.create = function create(properties) { - return new QueueStats(properties); - }; - - /** - * Encodes the specified QueueStats message. Does not implicitly {@link google.cloud.tasks.v2beta2.QueueStats.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {google.cloud.tasks.v2beta2.IQueueStats} message QueueStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueueStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasksCount != null && Object.hasOwnProperty.call(message, "tasksCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.tasksCount); - if (message.oldestEstimatedArrivalTime != null && Object.hasOwnProperty.call(message, "oldestEstimatedArrivalTime")) - $root.google.protobuf.Timestamp.encode(message.oldestEstimatedArrivalTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.executedLastMinuteCount != null && Object.hasOwnProperty.call(message, "executedLastMinuteCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.executedLastMinuteCount); - if (message.concurrentDispatchesCount != null && Object.hasOwnProperty.call(message, "concurrentDispatchesCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.concurrentDispatchesCount); - if (message.effectiveExecutionRate != null && Object.hasOwnProperty.call(message, "effectiveExecutionRate")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.effectiveExecutionRate); - return writer; - }; - - /** - * Encodes the specified QueueStats message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.QueueStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {google.cloud.tasks.v2beta2.IQueueStats} message QueueStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueueStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueueStats message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.QueueStats} QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueueStats.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.QueueStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.tasksCount = reader.int64(); - break; - } - case 2: { - message.oldestEstimatedArrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.executedLastMinuteCount = reader.int64(); - break; - } - case 4: { - message.concurrentDispatchesCount = reader.int64(); - break; - } - case 5: { - message.effectiveExecutionRate = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueueStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.QueueStats} QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueueStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueueStats message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueueStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasksCount != null && message.hasOwnProperty("tasksCount")) - if (!$util.isInteger(message.tasksCount) && !(message.tasksCount && $util.isInteger(message.tasksCount.low) && $util.isInteger(message.tasksCount.high))) - return "tasksCount: integer|Long expected"; - if (message.oldestEstimatedArrivalTime != null && message.hasOwnProperty("oldestEstimatedArrivalTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.oldestEstimatedArrivalTime); - if (error) - return "oldestEstimatedArrivalTime." + error; - } - if (message.executedLastMinuteCount != null && message.hasOwnProperty("executedLastMinuteCount")) - if (!$util.isInteger(message.executedLastMinuteCount) && !(message.executedLastMinuteCount && $util.isInteger(message.executedLastMinuteCount.low) && $util.isInteger(message.executedLastMinuteCount.high))) - return "executedLastMinuteCount: integer|Long expected"; - if (message.concurrentDispatchesCount != null && message.hasOwnProperty("concurrentDispatchesCount")) - if (!$util.isInteger(message.concurrentDispatchesCount) && !(message.concurrentDispatchesCount && $util.isInteger(message.concurrentDispatchesCount.low) && $util.isInteger(message.concurrentDispatchesCount.high))) - return "concurrentDispatchesCount: integer|Long expected"; - if (message.effectiveExecutionRate != null && message.hasOwnProperty("effectiveExecutionRate")) - if (typeof message.effectiveExecutionRate !== "number") - return "effectiveExecutionRate: number expected"; - return null; - }; - - /** - * Creates a QueueStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.QueueStats} QueueStats - */ - QueueStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.QueueStats) - return object; - var message = new $root.google.cloud.tasks.v2beta2.QueueStats(); - if (object.tasksCount != null) - if ($util.Long) - (message.tasksCount = $util.Long.fromValue(object.tasksCount)).unsigned = false; - else if (typeof object.tasksCount === "string") - message.tasksCount = parseInt(object.tasksCount, 10); - else if (typeof object.tasksCount === "number") - message.tasksCount = object.tasksCount; - else if (typeof object.tasksCount === "object") - message.tasksCount = new $util.LongBits(object.tasksCount.low >>> 0, object.tasksCount.high >>> 0).toNumber(); - if (object.oldestEstimatedArrivalTime != null) { - if (typeof object.oldestEstimatedArrivalTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.QueueStats.oldestEstimatedArrivalTime: object expected"); - message.oldestEstimatedArrivalTime = $root.google.protobuf.Timestamp.fromObject(object.oldestEstimatedArrivalTime); - } - if (object.executedLastMinuteCount != null) - if ($util.Long) - (message.executedLastMinuteCount = $util.Long.fromValue(object.executedLastMinuteCount)).unsigned = false; - else if (typeof object.executedLastMinuteCount === "string") - message.executedLastMinuteCount = parseInt(object.executedLastMinuteCount, 10); - else if (typeof object.executedLastMinuteCount === "number") - message.executedLastMinuteCount = object.executedLastMinuteCount; - else if (typeof object.executedLastMinuteCount === "object") - message.executedLastMinuteCount = new $util.LongBits(object.executedLastMinuteCount.low >>> 0, object.executedLastMinuteCount.high >>> 0).toNumber(); - if (object.concurrentDispatchesCount != null) - if ($util.Long) - (message.concurrentDispatchesCount = $util.Long.fromValue(object.concurrentDispatchesCount)).unsigned = false; - else if (typeof object.concurrentDispatchesCount === "string") - message.concurrentDispatchesCount = parseInt(object.concurrentDispatchesCount, 10); - else if (typeof object.concurrentDispatchesCount === "number") - message.concurrentDispatchesCount = object.concurrentDispatchesCount; - else if (typeof object.concurrentDispatchesCount === "object") - message.concurrentDispatchesCount = new $util.LongBits(object.concurrentDispatchesCount.low >>> 0, object.concurrentDispatchesCount.high >>> 0).toNumber(); - if (object.effectiveExecutionRate != null) - message.effectiveExecutionRate = Number(object.effectiveExecutionRate); - return message; - }; - - /** - * Creates a plain object from a QueueStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {google.cloud.tasks.v2beta2.QueueStats} message QueueStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueueStats.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.tasksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tasksCount = options.longs === String ? "0" : 0; - object.oldestEstimatedArrivalTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.executedLastMinuteCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.executedLastMinuteCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.concurrentDispatchesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.concurrentDispatchesCount = options.longs === String ? "0" : 0; - object.effectiveExecutionRate = 0; - } - if (message.tasksCount != null && message.hasOwnProperty("tasksCount")) - if (typeof message.tasksCount === "number") - object.tasksCount = options.longs === String ? String(message.tasksCount) : message.tasksCount; - else - object.tasksCount = options.longs === String ? $util.Long.prototype.toString.call(message.tasksCount) : options.longs === Number ? new $util.LongBits(message.tasksCount.low >>> 0, message.tasksCount.high >>> 0).toNumber() : message.tasksCount; - if (message.oldestEstimatedArrivalTime != null && message.hasOwnProperty("oldestEstimatedArrivalTime")) - object.oldestEstimatedArrivalTime = $root.google.protobuf.Timestamp.toObject(message.oldestEstimatedArrivalTime, options); - if (message.executedLastMinuteCount != null && message.hasOwnProperty("executedLastMinuteCount")) - if (typeof message.executedLastMinuteCount === "number") - object.executedLastMinuteCount = options.longs === String ? String(message.executedLastMinuteCount) : message.executedLastMinuteCount; - else - object.executedLastMinuteCount = options.longs === String ? $util.Long.prototype.toString.call(message.executedLastMinuteCount) : options.longs === Number ? new $util.LongBits(message.executedLastMinuteCount.low >>> 0, message.executedLastMinuteCount.high >>> 0).toNumber() : message.executedLastMinuteCount; - if (message.concurrentDispatchesCount != null && message.hasOwnProperty("concurrentDispatchesCount")) - if (typeof message.concurrentDispatchesCount === "number") - object.concurrentDispatchesCount = options.longs === String ? String(message.concurrentDispatchesCount) : message.concurrentDispatchesCount; - else - object.concurrentDispatchesCount = options.longs === String ? $util.Long.prototype.toString.call(message.concurrentDispatchesCount) : options.longs === Number ? new $util.LongBits(message.concurrentDispatchesCount.low >>> 0, message.concurrentDispatchesCount.high >>> 0).toNumber() : message.concurrentDispatchesCount; - if (message.effectiveExecutionRate != null && message.hasOwnProperty("effectiveExecutionRate")) - object.effectiveExecutionRate = options.json && !isFinite(message.effectiveExecutionRate) ? String(message.effectiveExecutionRate) : message.effectiveExecutionRate; - return object; - }; - - /** - * Converts this QueueStats to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @instance - * @returns {Object.} JSON object - */ - QueueStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueueStats - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.QueueStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueueStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.QueueStats"; - }; - - return QueueStats; - })(); - - v2beta2.PullTarget = (function() { - - /** - * Properties of a PullTarget. - * @memberof google.cloud.tasks.v2beta2 - * @interface IPullTarget - */ - - /** - * Constructs a new PullTarget. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a PullTarget. - * @implements IPullTarget - * @constructor - * @param {google.cloud.tasks.v2beta2.IPullTarget=} [properties] Properties to set - */ - function PullTarget(properties) { - if (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 PullTarget instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {google.cloud.tasks.v2beta2.IPullTarget=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.PullTarget} PullTarget instance - */ - PullTarget.create = function create(properties) { - return new PullTarget(properties); - }; - - /** - * Encodes the specified PullTarget message. Does not implicitly {@link google.cloud.tasks.v2beta2.PullTarget.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {google.cloud.tasks.v2beta2.IPullTarget} message PullTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullTarget.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified PullTarget message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PullTarget.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {google.cloud.tasks.v2beta2.IPullTarget} message PullTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullTarget.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PullTarget message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.PullTarget} PullTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullTarget.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.PullTarget(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PullTarget message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.PullTarget} PullTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullTarget.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PullTarget message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullTarget.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a PullTarget message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.PullTarget} PullTarget - */ - PullTarget.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.PullTarget) - return object; - return new $root.google.cloud.tasks.v2beta2.PullTarget(); - }; - - /** - * Creates a plain object from a PullTarget message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {google.cloud.tasks.v2beta2.PullTarget} message PullTarget - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullTarget.toObject = function toObject() { - return {}; - }; - - /** - * Converts this PullTarget to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @instance - * @returns {Object.} JSON object - */ - PullTarget.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PullTarget - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.PullTarget - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PullTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.PullTarget"; - }; - - return PullTarget; - })(); - - v2beta2.PullMessage = (function() { - - /** - * Properties of a PullMessage. - * @memberof google.cloud.tasks.v2beta2 - * @interface IPullMessage - * @property {Uint8Array|null} [payload] PullMessage payload - * @property {string|null} [tag] PullMessage tag - */ - - /** - * Constructs a new PullMessage. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a PullMessage. - * @implements IPullMessage - * @constructor - * @param {google.cloud.tasks.v2beta2.IPullMessage=} [properties] Properties to set - */ - function PullMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PullMessage payload. - * @member {Uint8Array} payload - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @instance - */ - PullMessage.prototype.payload = $util.newBuffer([]); - - /** - * PullMessage tag. - * @member {string} tag - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @instance - */ - PullMessage.prototype.tag = ""; - - /** - * Creates a new PullMessage instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {google.cloud.tasks.v2beta2.IPullMessage=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.PullMessage} PullMessage instance - */ - PullMessage.create = function create(properties) { - return new PullMessage(properties); - }; - - /** - * Encodes the specified PullMessage message. Does not implicitly {@link google.cloud.tasks.v2beta2.PullMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {google.cloud.tasks.v2beta2.IPullMessage} message PullMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payload); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); - return writer; - }; - - /** - * Encodes the specified PullMessage message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.PullMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {google.cloud.tasks.v2beta2.IPullMessage} message PullMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PullMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.PullMessage} PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.PullMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.payload = reader.bytes(); - break; - } - case 2: { - message.tag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PullMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.PullMessage} PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PullMessage message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.payload != null && message.hasOwnProperty("payload")) - if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) - return "payload: buffer expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; - return null; - }; - - /** - * Creates a PullMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.PullMessage} PullMessage - */ - PullMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.PullMessage) - return object; - var message = new $root.google.cloud.tasks.v2beta2.PullMessage(); - if (object.payload != null) - if (typeof object.payload === "string") - $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length >= 0) - message.payload = object.payload; - if (object.tag != null) - message.tag = String(object.tag); - return message; - }; - - /** - * Creates a plain object from a PullMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {google.cloud.tasks.v2beta2.PullMessage} message PullMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.payload = ""; - else { - object.payload = []; - if (options.bytes !== Array) - object.payload = $util.newBuffer(object.payload); - } - object.tag = ""; - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - return object; - }; - - /** - * Converts this PullMessage to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @instance - * @returns {Object.} JSON object - */ - PullMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PullMessage - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.PullMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PullMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.PullMessage"; - }; - - return PullMessage; - })(); - - v2beta2.AppEngineHttpTarget = (function() { - - /** - * Properties of an AppEngineHttpTarget. - * @memberof google.cloud.tasks.v2beta2 - * @interface IAppEngineHttpTarget - * @property {google.cloud.tasks.v2beta2.IAppEngineRouting|null} [appEngineRoutingOverride] AppEngineHttpTarget appEngineRoutingOverride - */ - - /** - * Constructs a new AppEngineHttpTarget. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents an AppEngineHttpTarget. - * @implements IAppEngineHttpTarget - * @constructor - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpTarget=} [properties] Properties to set - */ - function AppEngineHttpTarget(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineHttpTarget appEngineRoutingOverride. - * @member {google.cloud.tasks.v2beta2.IAppEngineRouting|null|undefined} appEngineRoutingOverride - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @instance - */ - AppEngineHttpTarget.prototype.appEngineRoutingOverride = null; - - /** - * Creates a new AppEngineHttpTarget instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpTarget=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpTarget} AppEngineHttpTarget instance - */ - AppEngineHttpTarget.create = function create(properties) { - return new AppEngineHttpTarget(properties); - }; - - /** - * Encodes the specified AppEngineHttpTarget message. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpTarget.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpTarget} message AppEngineHttpTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpTarget.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appEngineRoutingOverride != null && Object.hasOwnProperty.call(message, "appEngineRoutingOverride")) - $root.google.cloud.tasks.v2beta2.AppEngineRouting.encode(message.appEngineRoutingOverride, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppEngineHttpTarget message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpTarget.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpTarget} message AppEngineHttpTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpTarget.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineHttpTarget message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpTarget} AppEngineHttpTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpTarget.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.appEngineRoutingOverride = $root.google.cloud.tasks.v2beta2.AppEngineRouting.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineHttpTarget message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpTarget} AppEngineHttpTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpTarget.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineHttpTarget message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineHttpTarget.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.appEngineRoutingOverride != null && message.hasOwnProperty("appEngineRoutingOverride")) { - var error = $root.google.cloud.tasks.v2beta2.AppEngineRouting.verify(message.appEngineRoutingOverride); - if (error) - return "appEngineRoutingOverride." + error; - } - return null; - }; - - /** - * Creates an AppEngineHttpTarget message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpTarget} AppEngineHttpTarget - */ - AppEngineHttpTarget.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget) - return object; - var message = new $root.google.cloud.tasks.v2beta2.AppEngineHttpTarget(); - if (object.appEngineRoutingOverride != null) { - if (typeof object.appEngineRoutingOverride !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AppEngineHttpTarget.appEngineRoutingOverride: object expected"); - message.appEngineRoutingOverride = $root.google.cloud.tasks.v2beta2.AppEngineRouting.fromObject(object.appEngineRoutingOverride); - } - return message; - }; - - /** - * Creates a plain object from an AppEngineHttpTarget message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {google.cloud.tasks.v2beta2.AppEngineHttpTarget} message AppEngineHttpTarget - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineHttpTarget.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.appEngineRoutingOverride = null; - if (message.appEngineRoutingOverride != null && message.hasOwnProperty("appEngineRoutingOverride")) - object.appEngineRoutingOverride = $root.google.cloud.tasks.v2beta2.AppEngineRouting.toObject(message.appEngineRoutingOverride, options); - return object; - }; - - /** - * Converts this AppEngineHttpTarget to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @instance - * @returns {Object.} JSON object - */ - AppEngineHttpTarget.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineHttpTarget - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpTarget - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineHttpTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.AppEngineHttpTarget"; - }; - - return AppEngineHttpTarget; - })(); - - v2beta2.AppEngineHttpRequest = (function() { - - /** - * Properties of an AppEngineHttpRequest. - * @memberof google.cloud.tasks.v2beta2 - * @interface IAppEngineHttpRequest - * @property {google.cloud.tasks.v2beta2.HttpMethod|null} [httpMethod] AppEngineHttpRequest httpMethod - * @property {google.cloud.tasks.v2beta2.IAppEngineRouting|null} [appEngineRouting] AppEngineHttpRequest appEngineRouting - * @property {string|null} [relativeUrl] AppEngineHttpRequest relativeUrl - * @property {Object.|null} [headers] AppEngineHttpRequest headers - * @property {Uint8Array|null} [payload] AppEngineHttpRequest payload - */ - - /** - * Constructs a new AppEngineHttpRequest. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents an AppEngineHttpRequest. - * @implements IAppEngineHttpRequest - * @constructor - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpRequest=} [properties] Properties to set - */ - function AppEngineHttpRequest(properties) { - this.headers = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineHttpRequest httpMethod. - * @member {google.cloud.tasks.v2beta2.HttpMethod} httpMethod - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.httpMethod = 0; - - /** - * AppEngineHttpRequest appEngineRouting. - * @member {google.cloud.tasks.v2beta2.IAppEngineRouting|null|undefined} appEngineRouting - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.appEngineRouting = null; - - /** - * AppEngineHttpRequest relativeUrl. - * @member {string} relativeUrl - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.relativeUrl = ""; - - /** - * AppEngineHttpRequest headers. - * @member {Object.} headers - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.headers = $util.emptyObject; - - /** - * AppEngineHttpRequest payload. - * @member {Uint8Array} payload - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.payload = $util.newBuffer([]); - - /** - * Creates a new AppEngineHttpRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpRequest} AppEngineHttpRequest instance - */ - AppEngineHttpRequest.create = function create(properties) { - return new AppEngineHttpRequest(properties); - }; - - /** - * Encodes the specified AppEngineHttpRequest message. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpRequest} message AppEngineHttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.httpMethod); - if (message.appEngineRouting != null && Object.hasOwnProperty.call(message, "appEngineRouting")) - $root.google.cloud.tasks.v2beta2.AppEngineRouting.encode(message.appEngineRouting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.relativeUrl != null && Object.hasOwnProperty.call(message, "relativeUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relativeUrl); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.payload); - return writer; - }; - - /** - * Encodes the specified AppEngineHttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineHttpRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineHttpRequest} message AppEngineHttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpRequest} AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.httpMethod = reader.int32(); - break; - } - case 2: { - message.appEngineRouting = $root.google.cloud.tasks.v2beta2.AppEngineRouting.decode(reader, reader.uint32()); - break; - } - case 3: { - message.relativeUrl = reader.string(); - break; - } - case 4: { - if (message.headers === $util.emptyObject) - message.headers = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.headers[key] = value; - break; - } - case 5: { - message.payload = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpRequest} AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineHttpRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineHttpRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - switch (message.httpMethod) { - default: - return "httpMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.appEngineRouting != null && message.hasOwnProperty("appEngineRouting")) { - var error = $root.google.cloud.tasks.v2beta2.AppEngineRouting.verify(message.appEngineRouting); - if (error) - return "appEngineRouting." + error; - } - if (message.relativeUrl != null && message.hasOwnProperty("relativeUrl")) - if (!$util.isString(message.relativeUrl)) - return "relativeUrl: string expected"; - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; - } - if (message.payload != null && message.hasOwnProperty("payload")) - if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) - return "payload: buffer expected"; - return null; - }; - - /** - * Creates an AppEngineHttpRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.AppEngineHttpRequest} AppEngineHttpRequest - */ - AppEngineHttpRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest(); - switch (object.httpMethod) { - default: - if (typeof object.httpMethod === "number") { - message.httpMethod = object.httpMethod; - break; - } - break; - case "HTTP_METHOD_UNSPECIFIED": - case 0: - message.httpMethod = 0; - break; - case "POST": - case 1: - message.httpMethod = 1; - break; - case "GET": - case 2: - message.httpMethod = 2; - break; - case "HEAD": - case 3: - message.httpMethod = 3; - break; - case "PUT": - case 4: - message.httpMethod = 4; - break; - case "DELETE": - case 5: - message.httpMethod = 5; - break; - } - if (object.appEngineRouting != null) { - if (typeof object.appEngineRouting !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AppEngineHttpRequest.appEngineRouting: object expected"); - message.appEngineRouting = $root.google.cloud.tasks.v2beta2.AppEngineRouting.fromObject(object.appEngineRouting); - } - if (object.relativeUrl != null) - message.relativeUrl = String(object.relativeUrl); - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AppEngineHttpRequest.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); - } - if (object.payload != null) - if (typeof object.payload === "string") - $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length >= 0) - message.payload = object.payload; - return message; - }; - - /** - * Creates a plain object from an AppEngineHttpRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta2.AppEngineHttpRequest} message AppEngineHttpRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineHttpRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.headers = {}; - if (options.defaults) { - object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; - object.appEngineRouting = null; - object.relativeUrl = ""; - if (options.bytes === String) - object.payload = ""; - else { - object.payload = []; - if (options.bytes !== Array) - object.payload = $util.newBuffer(object.payload); - } - } - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - object.httpMethod = options.enums === String ? $root.google.cloud.tasks.v2beta2.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.tasks.v2beta2.HttpMethod[message.httpMethod] : message.httpMethod; - if (message.appEngineRouting != null && message.hasOwnProperty("appEngineRouting")) - object.appEngineRouting = $root.google.cloud.tasks.v2beta2.AppEngineRouting.toObject(message.appEngineRouting, options); - if (message.relativeUrl != null && message.hasOwnProperty("relativeUrl")) - object.relativeUrl = message.relativeUrl; - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; - return object; - }; - - /** - * Converts this AppEngineHttpRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @instance - * @returns {Object.} JSON object - */ - AppEngineHttpRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineHttpRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.AppEngineHttpRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineHttpRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.AppEngineHttpRequest"; - }; - - return AppEngineHttpRequest; - })(); - - v2beta2.AppEngineRouting = (function() { - - /** - * Properties of an AppEngineRouting. - * @memberof google.cloud.tasks.v2beta2 - * @interface IAppEngineRouting - * @property {string|null} [service] AppEngineRouting service - * @property {string|null} [version] AppEngineRouting version - * @property {string|null} [instance] AppEngineRouting instance - * @property {string|null} [host] AppEngineRouting host - */ - - /** - * Constructs a new AppEngineRouting. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents an AppEngineRouting. - * @implements IAppEngineRouting - * @constructor - * @param {google.cloud.tasks.v2beta2.IAppEngineRouting=} [properties] Properties to set - */ - function AppEngineRouting(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineRouting service. - * @member {string} service - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.service = ""; - - /** - * AppEngineRouting version. - * @member {string} version - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.version = ""; - - /** - * AppEngineRouting instance. - * @member {string} instance - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.instance = ""; - - /** - * AppEngineRouting host. - * @member {string} host - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.host = ""; - - /** - * Creates a new AppEngineRouting instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineRouting=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.AppEngineRouting} AppEngineRouting instance - */ - AppEngineRouting.create = function create(properties) { - return new AppEngineRouting(properties); - }; - - /** - * Encodes the specified AppEngineRouting message. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineRouting.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineRouting} message AppEngineRouting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineRouting.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instance); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - return writer; - }; - - /** - * Encodes the specified AppEngineRouting message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AppEngineRouting.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta2.IAppEngineRouting} message AppEngineRouting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineRouting.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.AppEngineRouting} AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineRouting.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.AppEngineRouting(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.instance = reader.string(); - break; - } - case 4: { - message.host = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.AppEngineRouting} AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineRouting.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineRouting message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineRouting.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) - if (!$util.isString(message.instance)) - return "instance: string expected"; - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - return null; - }; - - /** - * Creates an AppEngineRouting message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.AppEngineRouting} AppEngineRouting - */ - AppEngineRouting.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.AppEngineRouting) - return object; - var message = new $root.google.cloud.tasks.v2beta2.AppEngineRouting(); - if (object.service != null) - message.service = String(object.service); - if (object.version != null) - message.version = String(object.version); - if (object.instance != null) - message.instance = String(object.instance); - if (object.host != null) - message.host = String(object.host); - return message; - }; - - /** - * Creates a plain object from an AppEngineRouting message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta2.AppEngineRouting} message AppEngineRouting - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineRouting.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.service = ""; - object.version = ""; - object.instance = ""; - object.host = ""; - } - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = message.instance; - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - return object; - }; - - /** - * Converts this AppEngineRouting to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @instance - * @returns {Object.} JSON object - */ - AppEngineRouting.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineRouting - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.AppEngineRouting - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineRouting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.AppEngineRouting"; - }; - - return AppEngineRouting; - })(); - - /** - * HttpMethod enum. - * @name google.cloud.tasks.v2beta2.HttpMethod - * @enum {number} - * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value - * @property {number} POST=1 POST value - * @property {number} GET=2 GET value - * @property {number} HEAD=3 HEAD value - * @property {number} PUT=4 PUT value - * @property {number} DELETE=5 DELETE value - */ - v2beta2.HttpMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "POST"] = 1; - values[valuesById[2] = "GET"] = 2; - values[valuesById[3] = "HEAD"] = 3; - values[valuesById[4] = "PUT"] = 4; - values[valuesById[5] = "DELETE"] = 5; - return values; - })(); - - v2beta2.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.tasks.v2beta2 - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.tasks.v2beta2.IAppEngineHttpRequest|null} [appEngineHttpRequest] Task appEngineHttpRequest - * @property {google.cloud.tasks.v2beta2.IPullMessage|null} [pullMessage] Task pullMessage - * @property {google.protobuf.ITimestamp|null} [scheduleTime] Task scheduleTime - * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime - * @property {google.cloud.tasks.v2beta2.ITaskStatus|null} [status] Task status - * @property {google.cloud.tasks.v2beta2.Task.View|null} [view] Task view - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.tasks.v2beta2.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task appEngineHttpRequest. - * @member {google.cloud.tasks.v2beta2.IAppEngineHttpRequest|null|undefined} appEngineHttpRequest - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.appEngineHttpRequest = null; - - /** - * Task pullMessage. - * @member {google.cloud.tasks.v2beta2.IPullMessage|null|undefined} pullMessage - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.pullMessage = null; - - /** - * Task scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.scheduleTime = null; - - /** - * Task createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.createTime = null; - - /** - * Task status. - * @member {google.cloud.tasks.v2beta2.ITaskStatus|null|undefined} status - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.status = null; - - /** - * Task view. - * @member {google.cloud.tasks.v2beta2.Task.View} view - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Task.prototype.view = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Task payloadType. - * @member {"appEngineHttpRequest"|"pullMessage"|undefined} payloadType - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - */ - Object.defineProperty(Task.prototype, "payloadType", { - get: $util.oneOfGetter($oneOfFields = ["appEngineHttpRequest", "pullMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {google.cloud.tasks.v2beta2.ITask=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.tasks.v2beta2.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {google.cloud.tasks.v2beta2.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.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.appEngineHttpRequest != null && Object.hasOwnProperty.call(message, "appEngineHttpRequest")) - $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest.encode(message.appEngineHttpRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pullMessage != null && Object.hasOwnProperty.call(message, "pullMessage")) - $root.google.cloud.tasks.v2beta2.PullMessage.encode(message.pullMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - 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.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.tasks.v2beta2.TaskStatus.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.view); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {google.cloud.tasks.v2beta2.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.appEngineHttpRequest = $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pullMessage = $root.google.cloud.tasks.v2beta2.PullMessage.decode(reader, reader.uint32()); - break; - } - case 5: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.status = $root.google.cloud.tasks.v2beta2.TaskStatus.decode(reader, reader.uint32()); - break; - } - case 8: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.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.appEngineHttpRequest != null && message.hasOwnProperty("appEngineHttpRequest")) { - properties.payloadType = 1; - { - var error = $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest.verify(message.appEngineHttpRequest); - if (error) - return "appEngineHttpRequest." + error; - } - } - if (message.pullMessage != null && message.hasOwnProperty("pullMessage")) { - if (properties.payloadType === 1) - return "payloadType: multiple values"; - properties.payloadType = 1; - { - var error = $root.google.cloud.tasks.v2beta2.PullMessage.verify(message.pullMessage); - if (error) - return "pullMessage." + error; - } - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.tasks.v2beta2.TaskStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.Task) - return object; - var message = new $root.google.cloud.tasks.v2beta2.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.appEngineHttpRequest != null) { - if (typeof object.appEngineHttpRequest !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Task.appEngineHttpRequest: object expected"); - message.appEngineHttpRequest = $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest.fromObject(object.appEngineHttpRequest); - } - if (object.pullMessage != null) { - if (typeof object.pullMessage !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Task.pullMessage: object expected"); - message.pullMessage = $root.google.cloud.tasks.v2beta2.PullMessage.fromObject(object.pullMessage); - } - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Task.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Task.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.Task.status: object expected"); - message.status = $root.google.cloud.tasks.v2beta2.TaskStatus.fromObject(object.status); - } - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BASIC": - case 1: - message.view = 1; - break; - case "FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {google.cloud.tasks.v2beta2.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.scheduleTime = null; - object.createTime = null; - object.status = null; - object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appEngineHttpRequest != null && message.hasOwnProperty("appEngineHttpRequest")) { - object.appEngineHttpRequest = $root.google.cloud.tasks.v2beta2.AppEngineHttpRequest.toObject(message.appEngineHttpRequest, options); - if (options.oneofs) - object.payloadType = "appEngineHttpRequest"; - } - if (message.pullMessage != null && message.hasOwnProperty("pullMessage")) { - object.pullMessage = $root.google.cloud.tasks.v2beta2.PullMessage.toObject(message.pullMessage, options); - if (options.oneofs) - object.payloadType = "pullMessage"; - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.tasks.v2beta2.TaskStatus.toObject(message.status, options); - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.tasks.v2beta2.Task.View[message.view] === undefined ? message.view : $root.google.cloud.tasks.v2beta2.Task.View[message.view] : message.view; - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.Task"; - }; - - /** - * View enum. - * @name google.cloud.tasks.v2beta2.Task.View - * @enum {number} - * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value - * @property {number} BASIC=1 BASIC value - * @property {number} FULL=2 FULL value - */ - Task.View = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "BASIC"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); - - return Task; - })(); - - v2beta2.TaskStatus = (function() { - - /** - * Properties of a TaskStatus. - * @memberof google.cloud.tasks.v2beta2 - * @interface ITaskStatus - * @property {number|null} [attemptDispatchCount] TaskStatus attemptDispatchCount - * @property {number|null} [attemptResponseCount] TaskStatus attemptResponseCount - * @property {google.cloud.tasks.v2beta2.IAttemptStatus|null} [firstAttemptStatus] TaskStatus firstAttemptStatus - * @property {google.cloud.tasks.v2beta2.IAttemptStatus|null} [lastAttemptStatus] TaskStatus lastAttemptStatus - */ - - /** - * Constructs a new TaskStatus. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents a TaskStatus. - * @implements ITaskStatus - * @constructor - * @param {google.cloud.tasks.v2beta2.ITaskStatus=} [properties] Properties to set - */ - function TaskStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TaskStatus attemptDispatchCount. - * @member {number} attemptDispatchCount - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @instance - */ - TaskStatus.prototype.attemptDispatchCount = 0; - - /** - * TaskStatus attemptResponseCount. - * @member {number} attemptResponseCount - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @instance - */ - TaskStatus.prototype.attemptResponseCount = 0; - - /** - * TaskStatus firstAttemptStatus. - * @member {google.cloud.tasks.v2beta2.IAttemptStatus|null|undefined} firstAttemptStatus - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @instance - */ - TaskStatus.prototype.firstAttemptStatus = null; - - /** - * TaskStatus lastAttemptStatus. - * @member {google.cloud.tasks.v2beta2.IAttemptStatus|null|undefined} lastAttemptStatus - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @instance - */ - TaskStatus.prototype.lastAttemptStatus = null; - - /** - * Creates a new TaskStatus instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {google.cloud.tasks.v2beta2.ITaskStatus=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.TaskStatus} TaskStatus instance - */ - TaskStatus.create = function create(properties) { - return new TaskStatus(properties); - }; - - /** - * Encodes the specified TaskStatus message. Does not implicitly {@link google.cloud.tasks.v2beta2.TaskStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {google.cloud.tasks.v2beta2.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attemptDispatchCount != null && Object.hasOwnProperty.call(message, "attemptDispatchCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.attemptDispatchCount); - if (message.attemptResponseCount != null && Object.hasOwnProperty.call(message, "attemptResponseCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.attemptResponseCount); - if (message.firstAttemptStatus != null && Object.hasOwnProperty.call(message, "firstAttemptStatus")) - $root.google.cloud.tasks.v2beta2.AttemptStatus.encode(message.firstAttemptStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.lastAttemptStatus != null && Object.hasOwnProperty.call(message, "lastAttemptStatus")) - $root.google.cloud.tasks.v2beta2.AttemptStatus.encode(message.lastAttemptStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TaskStatus message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.TaskStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {google.cloud.tasks.v2beta2.ITaskStatus} message TaskStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TaskStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.TaskStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.attemptDispatchCount = reader.int32(); - break; - } - case 2: { - message.attemptResponseCount = reader.int32(); - break; - } - case 3: { - message.firstAttemptStatus = $root.google.cloud.tasks.v2beta2.AttemptStatus.decode(reader, reader.uint32()); - break; - } - case 4: { - message.lastAttemptStatus = $root.google.cloud.tasks.v2beta2.AttemptStatus.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TaskStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.TaskStatus} TaskStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TaskStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TaskStatus message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TaskStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attemptDispatchCount != null && message.hasOwnProperty("attemptDispatchCount")) - if (!$util.isInteger(message.attemptDispatchCount)) - return "attemptDispatchCount: integer expected"; - if (message.attemptResponseCount != null && message.hasOwnProperty("attemptResponseCount")) - if (!$util.isInteger(message.attemptResponseCount)) - return "attemptResponseCount: integer expected"; - if (message.firstAttemptStatus != null && message.hasOwnProperty("firstAttemptStatus")) { - var error = $root.google.cloud.tasks.v2beta2.AttemptStatus.verify(message.firstAttemptStatus); - if (error) - return "firstAttemptStatus." + error; - } - if (message.lastAttemptStatus != null && message.hasOwnProperty("lastAttemptStatus")) { - var error = $root.google.cloud.tasks.v2beta2.AttemptStatus.verify(message.lastAttemptStatus); - if (error) - return "lastAttemptStatus." + error; - } - return null; - }; - - /** - * Creates a TaskStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.TaskStatus} TaskStatus - */ - TaskStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.TaskStatus) - return object; - var message = new $root.google.cloud.tasks.v2beta2.TaskStatus(); - if (object.attemptDispatchCount != null) - message.attemptDispatchCount = object.attemptDispatchCount | 0; - if (object.attemptResponseCount != null) - message.attemptResponseCount = object.attemptResponseCount | 0; - if (object.firstAttemptStatus != null) { - if (typeof object.firstAttemptStatus !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.TaskStatus.firstAttemptStatus: object expected"); - message.firstAttemptStatus = $root.google.cloud.tasks.v2beta2.AttemptStatus.fromObject(object.firstAttemptStatus); - } - if (object.lastAttemptStatus != null) { - if (typeof object.lastAttemptStatus !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.TaskStatus.lastAttemptStatus: object expected"); - message.lastAttemptStatus = $root.google.cloud.tasks.v2beta2.AttemptStatus.fromObject(object.lastAttemptStatus); - } - return message; - }; - - /** - * Creates a plain object from a TaskStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {google.cloud.tasks.v2beta2.TaskStatus} message TaskStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TaskStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.attemptDispatchCount = 0; - object.attemptResponseCount = 0; - object.firstAttemptStatus = null; - object.lastAttemptStatus = null; - } - if (message.attemptDispatchCount != null && message.hasOwnProperty("attemptDispatchCount")) - object.attemptDispatchCount = message.attemptDispatchCount; - if (message.attemptResponseCount != null && message.hasOwnProperty("attemptResponseCount")) - object.attemptResponseCount = message.attemptResponseCount; - if (message.firstAttemptStatus != null && message.hasOwnProperty("firstAttemptStatus")) - object.firstAttemptStatus = $root.google.cloud.tasks.v2beta2.AttemptStatus.toObject(message.firstAttemptStatus, options); - if (message.lastAttemptStatus != null && message.hasOwnProperty("lastAttemptStatus")) - object.lastAttemptStatus = $root.google.cloud.tasks.v2beta2.AttemptStatus.toObject(message.lastAttemptStatus, options); - return object; - }; - - /** - * Converts this TaskStatus to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @instance - * @returns {Object.} JSON object - */ - TaskStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TaskStatus - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.TaskStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TaskStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.TaskStatus"; - }; - - return TaskStatus; - })(); - - v2beta2.AttemptStatus = (function() { - - /** - * Properties of an AttemptStatus. - * @memberof google.cloud.tasks.v2beta2 - * @interface IAttemptStatus - * @property {google.protobuf.ITimestamp|null} [scheduleTime] AttemptStatus scheduleTime - * @property {google.protobuf.ITimestamp|null} [dispatchTime] AttemptStatus dispatchTime - * @property {google.protobuf.ITimestamp|null} [responseTime] AttemptStatus responseTime - * @property {google.rpc.IStatus|null} [responseStatus] AttemptStatus responseStatus - */ - - /** - * Constructs a new AttemptStatus. - * @memberof google.cloud.tasks.v2beta2 - * @classdesc Represents an AttemptStatus. - * @implements IAttemptStatus - * @constructor - * @param {google.cloud.tasks.v2beta2.IAttemptStatus=} [properties] Properties to set - */ - function AttemptStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttemptStatus scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @instance - */ - AttemptStatus.prototype.scheduleTime = null; - - /** - * AttemptStatus dispatchTime. - * @member {google.protobuf.ITimestamp|null|undefined} dispatchTime - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @instance - */ - AttemptStatus.prototype.dispatchTime = null; - - /** - * AttemptStatus responseTime. - * @member {google.protobuf.ITimestamp|null|undefined} responseTime - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @instance - */ - AttemptStatus.prototype.responseTime = null; - - /** - * AttemptStatus responseStatus. - * @member {google.rpc.IStatus|null|undefined} responseStatus - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @instance - */ - AttemptStatus.prototype.responseStatus = null; - - /** - * Creates a new AttemptStatus instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {google.cloud.tasks.v2beta2.IAttemptStatus=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta2.AttemptStatus} AttemptStatus instance - */ - AttemptStatus.create = function create(properties) { - return new AttemptStatus(properties); - }; - - /** - * Encodes the specified AttemptStatus message. Does not implicitly {@link google.cloud.tasks.v2beta2.AttemptStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {google.cloud.tasks.v2beta2.IAttemptStatus} message AttemptStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttemptStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dispatchTime != null && Object.hasOwnProperty.call(message, "dispatchTime")) - $root.google.protobuf.Timestamp.encode(message.dispatchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseTime != null && Object.hasOwnProperty.call(message, "responseTime")) - $root.google.protobuf.Timestamp.encode(message.responseTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.responseStatus != null && Object.hasOwnProperty.call(message, "responseStatus")) - $root.google.rpc.Status.encode(message.responseStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttemptStatus message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta2.AttemptStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {google.cloud.tasks.v2beta2.IAttemptStatus} message AttemptStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttemptStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttemptStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta2.AttemptStatus} AttemptStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttemptStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta2.AttemptStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.dispatchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.responseStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttemptStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta2.AttemptStatus} AttemptStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttemptStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttemptStatus message. - * @function verify - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttemptStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.dispatchTime != null && message.hasOwnProperty("dispatchTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.dispatchTime); - if (error) - return "dispatchTime." + error; - } - if (message.responseTime != null && message.hasOwnProperty("responseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.responseTime); - if (error) - return "responseTime." + error; - } - if (message.responseStatus != null && message.hasOwnProperty("responseStatus")) { - var error = $root.google.rpc.Status.verify(message.responseStatus); - if (error) - return "responseStatus." + error; - } - return null; - }; - - /** - * Creates an AttemptStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta2.AttemptStatus} AttemptStatus - */ - AttemptStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta2.AttemptStatus) - return object; - var message = new $root.google.cloud.tasks.v2beta2.AttemptStatus(); - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AttemptStatus.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.dispatchTime != null) { - if (typeof object.dispatchTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AttemptStatus.dispatchTime: object expected"); - message.dispatchTime = $root.google.protobuf.Timestamp.fromObject(object.dispatchTime); - } - if (object.responseTime != null) { - if (typeof object.responseTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AttemptStatus.responseTime: object expected"); - message.responseTime = $root.google.protobuf.Timestamp.fromObject(object.responseTime); - } - if (object.responseStatus != null) { - if (typeof object.responseStatus !== "object") - throw TypeError(".google.cloud.tasks.v2beta2.AttemptStatus.responseStatus: object expected"); - message.responseStatus = $root.google.rpc.Status.fromObject(object.responseStatus); - } - return message; - }; - - /** - * Creates a plain object from an AttemptStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {google.cloud.tasks.v2beta2.AttemptStatus} message AttemptStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttemptStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scheduleTime = null; - object.dispatchTime = null; - object.responseTime = null; - object.responseStatus = null; - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.dispatchTime != null && message.hasOwnProperty("dispatchTime")) - object.dispatchTime = $root.google.protobuf.Timestamp.toObject(message.dispatchTime, options); - if (message.responseTime != null && message.hasOwnProperty("responseTime")) - object.responseTime = $root.google.protobuf.Timestamp.toObject(message.responseTime, options); - if (message.responseStatus != null && message.hasOwnProperty("responseStatus")) - object.responseStatus = $root.google.rpc.Status.toObject(message.responseStatus, options); - return object; - }; - - /** - * Converts this AttemptStatus to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @instance - * @returns {Object.} JSON object - */ - AttemptStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttemptStatus - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta2.AttemptStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttemptStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta2.AttemptStatus"; - }; - - return AttemptStatus; - })(); - - return v2beta2; - })(); - - tasks.v2beta3 = (function() { - - /** - * Namespace v2beta3. - * @memberof google.cloud.tasks - * @namespace - */ - var v2beta3 = {}; - - v2beta3.CloudTasks = (function() { - - /** - * Constructs a new CloudTasks service. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a CloudTasks - * @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 CloudTasks(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (CloudTasks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudTasks; - - /** - * Creates new CloudTasks service using the specified rpc implementation. - * @function create - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @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 {CloudTasks} RPC service. Useful where requests and/or responses are streamed. - */ - CloudTasks.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|listQueues}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef ListQueuesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.ListQueuesResponse} [response] ListQueuesResponse - */ - - /** - * Calls ListQueues. - * @function listQueues - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IListQueuesRequest} request ListQueuesRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.ListQueuesCallback} callback Node-style callback called with the error, if any, and ListQueuesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.listQueues = function listQueues(request, callback) { - return this.rpcCall(listQueues, $root.google.cloud.tasks.v2beta3.ListQueuesRequest, $root.google.cloud.tasks.v2beta3.ListQueuesResponse, request, callback); - }, "name", { value: "ListQueues" }); - - /** - * Calls ListQueues. - * @function listQueues - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IListQueuesRequest} request ListQueuesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|getQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef GetQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Queue} [response] Queue - */ - - /** - * Calls GetQueue. - * @function getQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IGetQueueRequest} request GetQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.GetQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getQueue = function getQueue(request, callback) { - return this.rpcCall(getQueue, $root.google.cloud.tasks.v2beta3.GetQueueRequest, $root.google.cloud.tasks.v2beta3.Queue, request, callback); - }, "name", { value: "GetQueue" }); - - /** - * Calls GetQueue. - * @function getQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IGetQueueRequest} request GetQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|createQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef CreateQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Queue} [response] Queue - */ - - /** - * Calls CreateQueue. - * @function createQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.ICreateQueueRequest} request CreateQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.CreateQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.createQueue = function createQueue(request, callback) { - return this.rpcCall(createQueue, $root.google.cloud.tasks.v2beta3.CreateQueueRequest, $root.google.cloud.tasks.v2beta3.Queue, request, callback); - }, "name", { value: "CreateQueue" }); - - /** - * Calls CreateQueue. - * @function createQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.ICreateQueueRequest} request CreateQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|updateQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef UpdateQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Queue} [response] Queue - */ - - /** - * Calls UpdateQueue. - * @function updateQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IUpdateQueueRequest} request UpdateQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.UpdateQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.updateQueue = function updateQueue(request, callback) { - return this.rpcCall(updateQueue, $root.google.cloud.tasks.v2beta3.UpdateQueueRequest, $root.google.cloud.tasks.v2beta3.Queue, request, callback); - }, "name", { value: "UpdateQueue" }); - - /** - * Calls UpdateQueue. - * @function updateQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IUpdateQueueRequest} request UpdateQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|deleteQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef DeleteQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteQueue. - * @function deleteQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IDeleteQueueRequest} request DeleteQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.DeleteQueueCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.deleteQueue = function deleteQueue(request, callback) { - return this.rpcCall(deleteQueue, $root.google.cloud.tasks.v2beta3.DeleteQueueRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteQueue" }); - - /** - * Calls DeleteQueue. - * @function deleteQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IDeleteQueueRequest} request DeleteQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|purgeQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef PurgeQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Queue} [response] Queue - */ - - /** - * Calls PurgeQueue. - * @function purgeQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IPurgeQueueRequest} request PurgeQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.PurgeQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.purgeQueue = function purgeQueue(request, callback) { - return this.rpcCall(purgeQueue, $root.google.cloud.tasks.v2beta3.PurgeQueueRequest, $root.google.cloud.tasks.v2beta3.Queue, request, callback); - }, "name", { value: "PurgeQueue" }); - - /** - * Calls PurgeQueue. - * @function purgeQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IPurgeQueueRequest} request PurgeQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|pauseQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef PauseQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Queue} [response] Queue - */ - - /** - * Calls PauseQueue. - * @function pauseQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IPauseQueueRequest} request PauseQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.PauseQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.pauseQueue = function pauseQueue(request, callback) { - return this.rpcCall(pauseQueue, $root.google.cloud.tasks.v2beta3.PauseQueueRequest, $root.google.cloud.tasks.v2beta3.Queue, request, callback); - }, "name", { value: "PauseQueue" }); - - /** - * Calls PauseQueue. - * @function pauseQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IPauseQueueRequest} request PauseQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|resumeQueue}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef ResumeQueueCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Queue} [response] Queue - */ - - /** - * Calls ResumeQueue. - * @function resumeQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IResumeQueueRequest} request ResumeQueueRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.ResumeQueueCallback} callback Node-style callback called with the error, if any, and Queue - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.resumeQueue = function resumeQueue(request, callback) { - return this.rpcCall(resumeQueue, $root.google.cloud.tasks.v2beta3.ResumeQueueRequest, $root.google.cloud.tasks.v2beta3.Queue, request, callback); - }, "name", { value: "ResumeQueue" }); - - /** - * Calls ResumeQueue. - * @function resumeQueue - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IResumeQueueRequest} request ResumeQueueRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|getIamPolicy}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|setIamPolicy}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|testIamPermissions}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|listTasks}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef ListTasksCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.ListTasksResponse} [response] ListTasksResponse - */ - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IListTasksRequest} request ListTasksRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.ListTasksCallback} callback Node-style callback called with the error, if any, and ListTasksResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.listTasks = function listTasks(request, callback) { - return this.rpcCall(listTasks, $root.google.cloud.tasks.v2beta3.ListTasksRequest, $root.google.cloud.tasks.v2beta3.ListTasksResponse, request, callback); - }, "name", { value: "ListTasks" }); - - /** - * Calls ListTasks. - * @function listTasks - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IListTasksRequest} request ListTasksRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|getTask}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef GetTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Task} [response] Task - */ - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IGetTaskRequest} request GetTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.GetTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.getTask = function getTask(request, callback) { - return this.rpcCall(getTask, $root.google.cloud.tasks.v2beta3.GetTaskRequest, $root.google.cloud.tasks.v2beta3.Task, request, callback); - }, "name", { value: "GetTask" }); - - /** - * Calls GetTask. - * @function getTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IGetTaskRequest} request GetTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|createTask}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef CreateTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Task} [response] Task - */ - - /** - * Calls CreateTask. - * @function createTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.ICreateTaskRequest} request CreateTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.CreateTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.createTask = function createTask(request, callback) { - return this.rpcCall(createTask, $root.google.cloud.tasks.v2beta3.CreateTaskRequest, $root.google.cloud.tasks.v2beta3.Task, request, callback); - }, "name", { value: "CreateTask" }); - - /** - * Calls CreateTask. - * @function createTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.ICreateTaskRequest} request CreateTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|deleteTask}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef DeleteTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteTask. - * @function deleteTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IDeleteTaskRequest} request DeleteTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.DeleteTaskCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.deleteTask = function deleteTask(request, callback) { - return this.rpcCall(deleteTask, $root.google.cloud.tasks.v2beta3.DeleteTaskRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteTask" }); - - /** - * Calls DeleteTask. - * @function deleteTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IDeleteTaskRequest} request DeleteTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.tasks.v2beta3.CloudTasks|runTask}. - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @typedef RunTaskCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.tasks.v2beta3.Task} [response] Task - */ - - /** - * Calls RunTask. - * @function runTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IRunTaskRequest} request RunTaskRequest message or plain object - * @param {google.cloud.tasks.v2beta3.CloudTasks.RunTaskCallback} callback Node-style callback called with the error, if any, and Task - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudTasks.prototype.runTask = function runTask(request, callback) { - return this.rpcCall(runTask, $root.google.cloud.tasks.v2beta3.RunTaskRequest, $root.google.cloud.tasks.v2beta3.Task, request, callback); - }, "name", { value: "RunTask" }); - - /** - * Calls RunTask. - * @function runTask - * @memberof google.cloud.tasks.v2beta3.CloudTasks - * @instance - * @param {google.cloud.tasks.v2beta3.IRunTaskRequest} request RunTaskRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return CloudTasks; - })(); - - v2beta3.ListQueuesRequest = (function() { - - /** - * Properties of a ListQueuesRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IListQueuesRequest - * @property {string|null} [parent] ListQueuesRequest parent - * @property {string|null} [filter] ListQueuesRequest filter - * @property {number|null} [pageSize] ListQueuesRequest pageSize - * @property {string|null} [pageToken] ListQueuesRequest pageToken - * @property {google.protobuf.IFieldMask|null} [readMask] ListQueuesRequest readMask - */ - - /** - * Constructs a new ListQueuesRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a ListQueuesRequest. - * @implements IListQueuesRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IListQueuesRequest=} [properties] Properties to set - */ - function ListQueuesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListQueuesRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.parent = ""; - - /** - * ListQueuesRequest filter. - * @member {string} filter - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.filter = ""; - - /** - * ListQueuesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.pageSize = 0; - - /** - * ListQueuesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.pageToken = ""; - - /** - * ListQueuesRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @instance - */ - ListQueuesRequest.prototype.readMask = null; - - /** - * Creates a new ListQueuesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta3.IListQueuesRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.ListQueuesRequest} ListQueuesRequest instance - */ - ListQueuesRequest.create = function create(properties) { - return new ListQueuesRequest(properties); - }; - - /** - * Encodes the specified ListQueuesRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta3.IListQueuesRequest} message ListQueuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListQueuesRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta3.IListQueuesRequest} message ListQueuesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.ListQueuesRequest} ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.ListQueuesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListQueuesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.ListQueuesRequest} ListQueuesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListQueuesRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListQueuesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } - return null; - }; - - /** - * Creates a ListQueuesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.ListQueuesRequest} ListQueuesRequest - */ - ListQueuesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.ListQueuesRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.ListQueuesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.ListQueuesRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - return message; - }; - - /** - * Creates a plain object from a ListQueuesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {google.cloud.tasks.v2beta3.ListQueuesRequest} message ListQueuesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListQueuesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.readMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - return object; - }; - - /** - * Converts this ListQueuesRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @instance - * @returns {Object.} JSON object - */ - ListQueuesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListQueuesRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.ListQueuesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListQueuesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.ListQueuesRequest"; - }; - - return ListQueuesRequest; - })(); - - v2beta3.ListQueuesResponse = (function() { - - /** - * Properties of a ListQueuesResponse. - * @memberof google.cloud.tasks.v2beta3 - * @interface IListQueuesResponse - * @property {Array.|null} [queues] ListQueuesResponse queues - * @property {string|null} [nextPageToken] ListQueuesResponse nextPageToken - */ - - /** - * Constructs a new ListQueuesResponse. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a ListQueuesResponse. - * @implements IListQueuesResponse - * @constructor - * @param {google.cloud.tasks.v2beta3.IListQueuesResponse=} [properties] Properties to set - */ - function ListQueuesResponse(properties) { - this.queues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListQueuesResponse queues. - * @member {Array.} queues - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @instance - */ - ListQueuesResponse.prototype.queues = $util.emptyArray; - - /** - * ListQueuesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @instance - */ - ListQueuesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListQueuesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta3.IListQueuesResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.ListQueuesResponse} ListQueuesResponse instance - */ - ListQueuesResponse.create = function create(properties) { - return new ListQueuesResponse(properties); - }; - - /** - * Encodes the specified ListQueuesResponse message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta3.IListQueuesResponse} message ListQueuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queues != null && message.queues.length) - for (var i = 0; i < message.queues.length; ++i) - $root.google.cloud.tasks.v2beta3.Queue.encode(message.queues[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 ListQueuesResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListQueuesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta3.IListQueuesResponse} message ListQueuesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListQueuesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.ListQueuesResponse} ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.ListQueuesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.queues && message.queues.length)) - message.queues = []; - message.queues.push($root.google.cloud.tasks.v2beta3.Queue.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListQueuesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.ListQueuesResponse} ListQueuesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListQueuesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListQueuesResponse message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListQueuesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queues != null && message.hasOwnProperty("queues")) { - if (!Array.isArray(message.queues)) - return "queues: array expected"; - for (var i = 0; i < message.queues.length; ++i) { - var error = $root.google.cloud.tasks.v2beta3.Queue.verify(message.queues[i]); - if (error) - return "queues." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListQueuesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.ListQueuesResponse} ListQueuesResponse - */ - ListQueuesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.ListQueuesResponse) - return object; - var message = new $root.google.cloud.tasks.v2beta3.ListQueuesResponse(); - if (object.queues) { - if (!Array.isArray(object.queues)) - throw TypeError(".google.cloud.tasks.v2beta3.ListQueuesResponse.queues: array expected"); - message.queues = []; - for (var i = 0; i < object.queues.length; ++i) { - if (typeof object.queues[i] !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.ListQueuesResponse.queues: object expected"); - message.queues[i] = $root.google.cloud.tasks.v2beta3.Queue.fromObject(object.queues[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListQueuesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {google.cloud.tasks.v2beta3.ListQueuesResponse} message ListQueuesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListQueuesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queues = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.queues && message.queues.length) { - object.queues = []; - for (var j = 0; j < message.queues.length; ++j) - object.queues[j] = $root.google.cloud.tasks.v2beta3.Queue.toObject(message.queues[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListQueuesResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @instance - * @returns {Object.} JSON object - */ - ListQueuesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListQueuesResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.ListQueuesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListQueuesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.ListQueuesResponse"; - }; - - return ListQueuesResponse; - })(); - - v2beta3.GetQueueRequest = (function() { - - /** - * Properties of a GetQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IGetQueueRequest - * @property {string|null} [name] GetQueueRequest name - * @property {google.protobuf.IFieldMask|null} [readMask] GetQueueRequest readMask - */ - - /** - * Constructs a new GetQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a GetQueueRequest. - * @implements IGetQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IGetQueueRequest=} [properties] Properties to set - */ - function GetQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @instance - */ - GetQueueRequest.prototype.name = ""; - - /** - * GetQueueRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @instance - */ - GetQueueRequest.prototype.readMask = null; - - /** - * Creates a new GetQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IGetQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.GetQueueRequest} GetQueueRequest instance - */ - GetQueueRequest.create = function create(properties) { - return new GetQueueRequest(properties); - }; - - /** - * Encodes the specified GetQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.GetQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IGetQueueRequest} message GetQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetQueueRequest.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.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.GetQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IGetQueueRequest} message GetQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.GetQueueRequest} GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.GetQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.GetQueueRequest} GetQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetQueueRequest.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.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } - return null; - }; - - /** - * Creates a GetQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.GetQueueRequest} GetQueueRequest - */ - GetQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.GetQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.GetQueueRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.GetQueueRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - return message; - }; - - /** - * Creates a plain object from a GetQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.GetQueueRequest} message GetQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.readMask = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); - return object; - }; - - /** - * Converts this GetQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @instance - * @returns {Object.} JSON object - */ - GetQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.GetQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.GetQueueRequest"; - }; - - return GetQueueRequest; - })(); - - v2beta3.CreateQueueRequest = (function() { - - /** - * Properties of a CreateQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface ICreateQueueRequest - * @property {string|null} [parent] CreateQueueRequest parent - * @property {google.cloud.tasks.v2beta3.IQueue|null} [queue] CreateQueueRequest queue - */ - - /** - * Constructs a new CreateQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a CreateQueueRequest. - * @implements ICreateQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.ICreateQueueRequest=} [properties] Properties to set - */ - function CreateQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateQueueRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @instance - */ - CreateQueueRequest.prototype.parent = ""; - - /** - * CreateQueueRequest queue. - * @member {google.cloud.tasks.v2beta3.IQueue|null|undefined} queue - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @instance - */ - CreateQueueRequest.prototype.queue = null; - - /** - * Creates a new CreateQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.ICreateQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.CreateQueueRequest} CreateQueueRequest instance - */ - CreateQueueRequest.create = function create(properties) { - return new CreateQueueRequest(properties); - }; - - /** - * Encodes the specified CreateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.ICreateQueueRequest} message CreateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateQueueRequest.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.queue != null && Object.hasOwnProperty.call(message, "queue")) - $root.google.cloud.tasks.v2beta3.Queue.encode(message.queue, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.ICreateQueueRequest} message CreateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.CreateQueueRequest} CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.CreateQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.queue = $root.google.cloud.tasks.v2beta3.Queue.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.CreateQueueRequest} CreateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateQueueRequest.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.queue != null && message.hasOwnProperty("queue")) { - var error = $root.google.cloud.tasks.v2beta3.Queue.verify(message.queue); - if (error) - return "queue." + error; - } - return null; - }; - - /** - * Creates a CreateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.CreateQueueRequest} CreateQueueRequest - */ - CreateQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.CreateQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.CreateQueueRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.queue != null) { - if (typeof object.queue !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.CreateQueueRequest.queue: object expected"); - message.queue = $root.google.cloud.tasks.v2beta3.Queue.fromObject(object.queue); - } - return message; - }; - - /** - * Creates a plain object from a CreateQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.CreateQueueRequest} message CreateQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.queue = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = $root.google.cloud.tasks.v2beta3.Queue.toObject(message.queue, options); - return object; - }; - - /** - * Converts this CreateQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @instance - * @returns {Object.} JSON object - */ - CreateQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.CreateQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.CreateQueueRequest"; - }; - - return CreateQueueRequest; - })(); - - v2beta3.UpdateQueueRequest = (function() { - - /** - * Properties of an UpdateQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IUpdateQueueRequest - * @property {google.cloud.tasks.v2beta3.IQueue|null} [queue] UpdateQueueRequest queue - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateQueueRequest updateMask - */ - - /** - * Constructs a new UpdateQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents an UpdateQueueRequest. - * @implements IUpdateQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IUpdateQueueRequest=} [properties] Properties to set - */ - function UpdateQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateQueueRequest queue. - * @member {google.cloud.tasks.v2beta3.IQueue|null|undefined} queue - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @instance - */ - UpdateQueueRequest.prototype.queue = null; - - /** - * UpdateQueueRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @instance - */ - UpdateQueueRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IUpdateQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.UpdateQueueRequest} UpdateQueueRequest instance - */ - UpdateQueueRequest.create = function create(properties) { - return new UpdateQueueRequest(properties); - }; - - /** - * Encodes the specified UpdateQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.UpdateQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IUpdateQueueRequest} message UpdateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateQueueRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queue != null && Object.hasOwnProperty.call(message, "queue")) - $root.google.cloud.tasks.v2beta3.Queue.encode(message.queue, 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 UpdateQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.UpdateQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IUpdateQueueRequest} message UpdateQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.UpdateQueueRequest} UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.UpdateQueueRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.queue = $root.google.cloud.tasks.v2beta3.Queue.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 UpdateQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.UpdateQueueRequest} UpdateQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateQueueRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queue != null && message.hasOwnProperty("queue")) { - var error = $root.google.cloud.tasks.v2beta3.Queue.verify(message.queue); - if (error) - return "queue." + 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 UpdateQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.UpdateQueueRequest} UpdateQueueRequest - */ - UpdateQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.UpdateQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.UpdateQueueRequest(); - if (object.queue != null) { - if (typeof object.queue !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.UpdateQueueRequest.queue: object expected"); - message.queue = $root.google.cloud.tasks.v2beta3.Queue.fromObject(object.queue); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.UpdateQueueRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.UpdateQueueRequest} message UpdateQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateQueueRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.queue = null; - object.updateMask = null; - } - if (message.queue != null && message.hasOwnProperty("queue")) - object.queue = $root.google.cloud.tasks.v2beta3.Queue.toObject(message.queue, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.UpdateQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.UpdateQueueRequest"; - }; - - return UpdateQueueRequest; - })(); - - v2beta3.DeleteQueueRequest = (function() { - - /** - * Properties of a DeleteQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IDeleteQueueRequest - * @property {string|null} [name] DeleteQueueRequest name - */ - - /** - * Constructs a new DeleteQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a DeleteQueueRequest. - * @implements IDeleteQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IDeleteQueueRequest=} [properties] Properties to set - */ - function DeleteQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @instance - */ - DeleteQueueRequest.prototype.name = ""; - - /** - * Creates a new DeleteQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IDeleteQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.DeleteQueueRequest} DeleteQueueRequest instance - */ - DeleteQueueRequest.create = function create(properties) { - return new DeleteQueueRequest(properties); - }; - - /** - * Encodes the specified DeleteQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IDeleteQueueRequest} message DeleteQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteQueueRequest.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 DeleteQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IDeleteQueueRequest} message DeleteQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.DeleteQueueRequest} DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.DeleteQueueRequest(); - 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 DeleteQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.DeleteQueueRequest} DeleteQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteQueueRequest.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 DeleteQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.DeleteQueueRequest} DeleteQueueRequest - */ - DeleteQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.DeleteQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.DeleteQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.DeleteQueueRequest} message DeleteQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteQueueRequest.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 DeleteQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.DeleteQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.DeleteQueueRequest"; - }; - - return DeleteQueueRequest; - })(); - - v2beta3.PurgeQueueRequest = (function() { - - /** - * Properties of a PurgeQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IPurgeQueueRequest - * @property {string|null} [name] PurgeQueueRequest name - */ - - /** - * Constructs a new PurgeQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a PurgeQueueRequest. - * @implements IPurgeQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IPurgeQueueRequest=} [properties] Properties to set - */ - function PurgeQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PurgeQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @instance - */ - PurgeQueueRequest.prototype.name = ""; - - /** - * Creates a new PurgeQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IPurgeQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.PurgeQueueRequest} PurgeQueueRequest instance - */ - PurgeQueueRequest.create = function create(properties) { - return new PurgeQueueRequest(properties); - }; - - /** - * Encodes the specified PurgeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.PurgeQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IPurgeQueueRequest} message PurgeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeQueueRequest.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 PurgeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.PurgeQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IPurgeQueueRequest} message PurgeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PurgeQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PurgeQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.PurgeQueueRequest} PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.PurgeQueueRequest(); - 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 PurgeQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.PurgeQueueRequest} PurgeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PurgeQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PurgeQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PurgeQueueRequest.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 PurgeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.PurgeQueueRequest} PurgeQueueRequest - */ - PurgeQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.PurgeQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.PurgeQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PurgeQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.PurgeQueueRequest} message PurgeQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PurgeQueueRequest.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 PurgeQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @instance - * @returns {Object.} JSON object - */ - PurgeQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PurgeQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.PurgeQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PurgeQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.PurgeQueueRequest"; - }; - - return PurgeQueueRequest; - })(); - - v2beta3.PauseQueueRequest = (function() { - - /** - * Properties of a PauseQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IPauseQueueRequest - * @property {string|null} [name] PauseQueueRequest name - */ - - /** - * Constructs a new PauseQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a PauseQueueRequest. - * @implements IPauseQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IPauseQueueRequest=} [properties] Properties to set - */ - function PauseQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PauseQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @instance - */ - PauseQueueRequest.prototype.name = ""; - - /** - * Creates a new PauseQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IPauseQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.PauseQueueRequest} PauseQueueRequest instance - */ - PauseQueueRequest.create = function create(properties) { - return new PauseQueueRequest(properties); - }; - - /** - * Encodes the specified PauseQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.PauseQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IPauseQueueRequest} message PauseQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PauseQueueRequest.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 PauseQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.PauseQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IPauseQueueRequest} message PauseQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PauseQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PauseQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.PauseQueueRequest} PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PauseQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.PauseQueueRequest(); - 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 PauseQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.PauseQueueRequest} PauseQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PauseQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PauseQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PauseQueueRequest.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 PauseQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.PauseQueueRequest} PauseQueueRequest - */ - PauseQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.PauseQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.PauseQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a PauseQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.PauseQueueRequest} message PauseQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PauseQueueRequest.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 PauseQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @instance - * @returns {Object.} JSON object - */ - PauseQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PauseQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.PauseQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PauseQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.PauseQueueRequest"; - }; - - return PauseQueueRequest; - })(); - - v2beta3.ResumeQueueRequest = (function() { - - /** - * Properties of a ResumeQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IResumeQueueRequest - * @property {string|null} [name] ResumeQueueRequest name - */ - - /** - * Constructs a new ResumeQueueRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a ResumeQueueRequest. - * @implements IResumeQueueRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IResumeQueueRequest=} [properties] Properties to set - */ - function ResumeQueueRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResumeQueueRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @instance - */ - ResumeQueueRequest.prototype.name = ""; - - /** - * Creates a new ResumeQueueRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IResumeQueueRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.ResumeQueueRequest} ResumeQueueRequest instance - */ - ResumeQueueRequest.create = function create(properties) { - return new ResumeQueueRequest(properties); - }; - - /** - * Encodes the specified ResumeQueueRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.ResumeQueueRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IResumeQueueRequest} message ResumeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResumeQueueRequest.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 ResumeQueueRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ResumeQueueRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.IResumeQueueRequest} message ResumeQueueRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResumeQueueRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResumeQueueRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.ResumeQueueRequest} ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResumeQueueRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.ResumeQueueRequest(); - 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 ResumeQueueRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.ResumeQueueRequest} ResumeQueueRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResumeQueueRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResumeQueueRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResumeQueueRequest.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 ResumeQueueRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.ResumeQueueRequest} ResumeQueueRequest - */ - ResumeQueueRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.ResumeQueueRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.ResumeQueueRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a ResumeQueueRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {google.cloud.tasks.v2beta3.ResumeQueueRequest} message ResumeQueueRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResumeQueueRequest.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 ResumeQueueRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @instance - * @returns {Object.} JSON object - */ - ResumeQueueRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResumeQueueRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.ResumeQueueRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResumeQueueRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.ResumeQueueRequest"; - }; - - return ResumeQueueRequest; - })(); - - v2beta3.ListTasksRequest = (function() { - - /** - * Properties of a ListTasksRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IListTasksRequest - * @property {string|null} [parent] ListTasksRequest parent - * @property {google.cloud.tasks.v2beta3.Task.View|null} [responseView] ListTasksRequest responseView - * @property {number|null} [pageSize] ListTasksRequest pageSize - * @property {string|null} [pageToken] ListTasksRequest pageToken - */ - - /** - * Constructs a new ListTasksRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a ListTasksRequest. - * @implements IListTasksRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IListTasksRequest=} [properties] Properties to set - */ - function ListTasksRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.parent = ""; - - /** - * ListTasksRequest responseView. - * @member {google.cloud.tasks.v2beta3.Task.View} responseView - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.responseView = 0; - - /** - * ListTasksRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageSize = 0; - - /** - * ListTasksRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @instance - */ - ListTasksRequest.prototype.pageToken = ""; - - /** - * Creates a new ListTasksRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta3.IListTasksRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.ListTasksRequest} ListTasksRequest instance - */ - ListTasksRequest.create = function create(properties) { - return new ListTasksRequest(properties); - }; - - /** - * Encodes the specified ListTasksRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta3.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListTasksRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta3.IListTasksRequest} message ListTasksRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.ListTasksRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.ListTasksRequest} ListTasksRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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 ListTasksRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.ListTasksRequest} ListTasksRequest - */ - ListTasksRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.ListTasksRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.ListTasksRequest(); - if (object.parent != null) - message.parent = String(object.parent); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - 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 ListTasksRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {google.cloud.tasks.v2beta3.ListTasksRequest} message ListTasksRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] : message.responseView; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListTasksRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @instance - * @returns {Object.} JSON object - */ - ListTasksRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.ListTasksRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.ListTasksRequest"; - }; - - return ListTasksRequest; - })(); - - v2beta3.ListTasksResponse = (function() { - - /** - * Properties of a ListTasksResponse. - * @memberof google.cloud.tasks.v2beta3 - * @interface IListTasksResponse - * @property {Array.|null} [tasks] ListTasksResponse tasks - * @property {string|null} [nextPageToken] ListTasksResponse nextPageToken - */ - - /** - * Constructs a new ListTasksResponse. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a ListTasksResponse. - * @implements IListTasksResponse - * @constructor - * @param {google.cloud.tasks.v2beta3.IListTasksResponse=} [properties] Properties to set - */ - function ListTasksResponse(properties) { - this.tasks = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListTasksResponse tasks. - * @member {Array.} tasks - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.tasks = $util.emptyArray; - - /** - * ListTasksResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @instance - */ - ListTasksResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListTasksResponse instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta3.IListTasksResponse=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.ListTasksResponse} ListTasksResponse instance - */ - ListTasksResponse.create = function create(properties) { - return new ListTasksResponse(properties); - }; - - /** - * Encodes the specified ListTasksResponse message. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta3.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasks != null && message.tasks.length) - for (var i = 0; i < message.tasks.length; ++i) - $root.google.cloud.tasks.v2beta3.Task.encode(message.tasks[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 ListTasksResponse message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.ListTasksResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta3.IListTasksResponse} message ListTasksResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListTasksResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.ListTasksResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tasks && message.tasks.length)) - message.tasks = []; - message.tasks.push($root.google.cloud.tasks.v2beta3.Task.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListTasksResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.ListTasksResponse} ListTasksResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListTasksResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListTasksResponse message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListTasksResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasks != null && message.hasOwnProperty("tasks")) { - if (!Array.isArray(message.tasks)) - return "tasks: array expected"; - for (var i = 0; i < message.tasks.length; ++i) { - var error = $root.google.cloud.tasks.v2beta3.Task.verify(message.tasks[i]); - if (error) - return "tasks." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListTasksResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.ListTasksResponse} ListTasksResponse - */ - ListTasksResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.ListTasksResponse) - return object; - var message = new $root.google.cloud.tasks.v2beta3.ListTasksResponse(); - if (object.tasks) { - if (!Array.isArray(object.tasks)) - throw TypeError(".google.cloud.tasks.v2beta3.ListTasksResponse.tasks: array expected"); - message.tasks = []; - for (var i = 0; i < object.tasks.length; ++i) { - if (typeof object.tasks[i] !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.ListTasksResponse.tasks: object expected"); - message.tasks[i] = $root.google.cloud.tasks.v2beta3.Task.fromObject(object.tasks[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListTasksResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {google.cloud.tasks.v2beta3.ListTasksResponse} message ListTasksResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListTasksResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tasks = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tasks && message.tasks.length) { - object.tasks = []; - for (var j = 0; j < message.tasks.length; ++j) - object.tasks[j] = $root.google.cloud.tasks.v2beta3.Task.toObject(message.tasks[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListTasksResponse to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @instance - * @returns {Object.} JSON object - */ - ListTasksResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListTasksResponse - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.ListTasksResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListTasksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.ListTasksResponse"; - }; - - return ListTasksResponse; - })(); - - v2beta3.GetTaskRequest = (function() { - - /** - * Properties of a GetTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IGetTaskRequest - * @property {string|null} [name] GetTaskRequest name - * @property {google.cloud.tasks.v2beta3.Task.View|null} [responseView] GetTaskRequest responseView - */ - - /** - * Constructs a new GetTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a GetTaskRequest. - * @implements IGetTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IGetTaskRequest=} [properties] Properties to set - */ - function GetTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.name = ""; - - /** - * GetTaskRequest responseView. - * @member {google.cloud.tasks.v2beta3.Task.View} responseView - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @instance - */ - GetTaskRequest.prototype.responseView = 0; - - /** - * Creates a new GetTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IGetTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.GetTaskRequest} GetTaskRequest instance - */ - GetTaskRequest.create = function create(properties) { - return new GetTaskRequest(properties); - }; - - /** - * Encodes the specified GetTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.GetTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified GetTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.GetTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IGetTaskRequest} message GetTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.GetTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.GetTaskRequest} GetTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetTaskRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.GetTaskRequest} GetTaskRequest - */ - GetTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.GetTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.GetTaskRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.GetTaskRequest} message GetTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this GetTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @instance - * @returns {Object.} JSON object - */ - GetTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.GetTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.GetTaskRequest"; - }; - - return GetTaskRequest; - })(); - - v2beta3.CreateTaskRequest = (function() { - - /** - * Properties of a CreateTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface ICreateTaskRequest - * @property {string|null} [parent] CreateTaskRequest parent - * @property {google.cloud.tasks.v2beta3.ITask|null} [task] CreateTaskRequest task - * @property {google.cloud.tasks.v2beta3.Task.View|null} [responseView] CreateTaskRequest responseView - */ - - /** - * Constructs a new CreateTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a CreateTaskRequest. - * @implements ICreateTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.ICreateTaskRequest=} [properties] Properties to set - */ - function CreateTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateTaskRequest parent. - * @member {string} parent - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.parent = ""; - - /** - * CreateTaskRequest task. - * @member {google.cloud.tasks.v2beta3.ITask|null|undefined} task - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.task = null; - - /** - * CreateTaskRequest responseView. - * @member {google.cloud.tasks.v2beta3.Task.View} responseView - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @instance - */ - CreateTaskRequest.prototype.responseView = 0; - - /** - * Creates a new CreateTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.ICreateTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.CreateTaskRequest} CreateTaskRequest instance - */ - CreateTaskRequest.create = function create(properties) { - return new CreateTaskRequest(properties); - }; - - /** - * Encodes the specified CreateTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateTaskRequest.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.task != null && Object.hasOwnProperty.call(message, "task")) - $root.google.cloud.tasks.v2beta3.Task.encode(message.task, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified CreateTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.CreateTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.ICreateTaskRequest} message CreateTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.CreateTaskRequest} CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.CreateTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.task = $root.google.cloud.tasks.v2beta3.Task.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.CreateTaskRequest} CreateTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateTaskRequest.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.task != null && message.hasOwnProperty("task")) { - var error = $root.google.cloud.tasks.v2beta3.Task.verify(message.task); - if (error) - return "task." + error; - } - if (message.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CreateTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.CreateTaskRequest} CreateTaskRequest - */ - CreateTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.CreateTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.CreateTaskRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.task != null) { - if (typeof object.task !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.CreateTaskRequest.task: object expected"); - message.task = $root.google.cloud.tasks.v2beta3.Task.fromObject(object.task); - } - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.CreateTaskRequest} message CreateTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.task = null; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.task != null && message.hasOwnProperty("task")) - object.task = $root.google.cloud.tasks.v2beta3.Task.toObject(message.task, options); - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this CreateTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @instance - * @returns {Object.} JSON object - */ - CreateTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.CreateTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.CreateTaskRequest"; - }; - - return CreateTaskRequest; - })(); - - v2beta3.DeleteTaskRequest = (function() { - - /** - * Properties of a DeleteTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IDeleteTaskRequest - * @property {string|null} [name] DeleteTaskRequest name - */ - - /** - * Constructs a new DeleteTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a DeleteTaskRequest. - * @implements IDeleteTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IDeleteTaskRequest=} [properties] Properties to set - */ - function DeleteTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @instance - */ - DeleteTaskRequest.prototype.name = ""; - - /** - * Creates a new DeleteTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IDeleteTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.DeleteTaskRequest} DeleteTaskRequest instance - */ - DeleteTaskRequest.create = function create(properties) { - return new DeleteTaskRequest(properties); - }; - - /** - * Encodes the specified DeleteTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTaskRequest.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 DeleteTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.DeleteTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IDeleteTaskRequest} message DeleteTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.DeleteTaskRequest} DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.DeleteTaskRequest(); - 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 DeleteTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.DeleteTaskRequest} DeleteTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteTaskRequest.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 DeleteTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.DeleteTaskRequest} DeleteTaskRequest - */ - DeleteTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.DeleteTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.DeleteTaskRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.DeleteTaskRequest} message DeleteTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteTaskRequest.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 DeleteTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.DeleteTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.DeleteTaskRequest"; - }; - - return DeleteTaskRequest; - })(); - - v2beta3.RunTaskRequest = (function() { - - /** - * Properties of a RunTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IRunTaskRequest - * @property {string|null} [name] RunTaskRequest name - * @property {google.cloud.tasks.v2beta3.Task.View|null} [responseView] RunTaskRequest responseView - */ - - /** - * Constructs a new RunTaskRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a RunTaskRequest. - * @implements IRunTaskRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IRunTaskRequest=} [properties] Properties to set - */ - function RunTaskRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunTaskRequest name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @instance - */ - RunTaskRequest.prototype.name = ""; - - /** - * RunTaskRequest responseView. - * @member {google.cloud.tasks.v2beta3.Task.View} responseView - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @instance - */ - RunTaskRequest.prototype.responseView = 0; - - /** - * Creates a new RunTaskRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IRunTaskRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.RunTaskRequest} RunTaskRequest instance - */ - RunTaskRequest.create = function create(properties) { - return new RunTaskRequest(properties); - }; - - /** - * Encodes the specified RunTaskRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.RunTaskRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IRunTaskRequest} message RunTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunTaskRequest.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.responseView != null && Object.hasOwnProperty.call(message, "responseView")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.responseView); - return writer; - }; - - /** - * Encodes the specified RunTaskRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.RunTaskRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.IRunTaskRequest} message RunTaskRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunTaskRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.RunTaskRequest} RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunTaskRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.RunTaskRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.responseView = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunTaskRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.RunTaskRequest} RunTaskRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunTaskRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunTaskRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunTaskRequest.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.responseView != null && message.hasOwnProperty("responseView")) - switch (message.responseView) { - default: - return "responseView: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a RunTaskRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.RunTaskRequest} RunTaskRequest - */ - RunTaskRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.RunTaskRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.RunTaskRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.responseView) { - default: - if (typeof object.responseView === "number") { - message.responseView = object.responseView; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.responseView = 0; - break; - case "BASIC": - case 1: - message.responseView = 1; - break; - case "FULL": - case 2: - message.responseView = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a RunTaskRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {google.cloud.tasks.v2beta3.RunTaskRequest} message RunTaskRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunTaskRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.responseView = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.responseView != null && message.hasOwnProperty("responseView")) - object.responseView = options.enums === String ? $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] === undefined ? message.responseView : $root.google.cloud.tasks.v2beta3.Task.View[message.responseView] : message.responseView; - return object; - }; - - /** - * Converts this RunTaskRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @instance - * @returns {Object.} JSON object - */ - RunTaskRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunTaskRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.RunTaskRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunTaskRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.RunTaskRequest"; - }; - - return RunTaskRequest; - })(); - - v2beta3.Queue = (function() { - - /** - * Properties of a Queue. - * @memberof google.cloud.tasks.v2beta3 - * @interface IQueue - * @property {string|null} [name] Queue name - * @property {google.cloud.tasks.v2beta3.IAppEngineHttpQueue|null} [appEngineHttpQueue] Queue appEngineHttpQueue - * @property {google.cloud.tasks.v2beta3.IRateLimits|null} [rateLimits] Queue rateLimits - * @property {google.cloud.tasks.v2beta3.IRetryConfig|null} [retryConfig] Queue retryConfig - * @property {google.cloud.tasks.v2beta3.Queue.State|null} [state] Queue state - * @property {google.protobuf.ITimestamp|null} [purgeTime] Queue purgeTime - * @property {google.protobuf.IDuration|null} [taskTtl] Queue taskTtl - * @property {google.protobuf.IDuration|null} [tombstoneTtl] Queue tombstoneTtl - * @property {google.cloud.tasks.v2beta3.IStackdriverLoggingConfig|null} [stackdriverLoggingConfig] Queue stackdriverLoggingConfig - * @property {google.cloud.tasks.v2beta3.Queue.Type|null} [type] Queue type - * @property {google.cloud.tasks.v2beta3.IQueueStats|null} [stats] Queue stats - */ - - /** - * Constructs a new Queue. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a Queue. - * @implements IQueue - * @constructor - * @param {google.cloud.tasks.v2beta3.IQueue=} [properties] Properties to set - */ - function Queue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Queue name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.name = ""; - - /** - * Queue appEngineHttpQueue. - * @member {google.cloud.tasks.v2beta3.IAppEngineHttpQueue|null|undefined} appEngineHttpQueue - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.appEngineHttpQueue = null; - - /** - * Queue rateLimits. - * @member {google.cloud.tasks.v2beta3.IRateLimits|null|undefined} rateLimits - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.rateLimits = null; - - /** - * Queue retryConfig. - * @member {google.cloud.tasks.v2beta3.IRetryConfig|null|undefined} retryConfig - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.retryConfig = null; - - /** - * Queue state. - * @member {google.cloud.tasks.v2beta3.Queue.State} state - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.state = 0; - - /** - * Queue purgeTime. - * @member {google.protobuf.ITimestamp|null|undefined} purgeTime - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.purgeTime = null; - - /** - * Queue taskTtl. - * @member {google.protobuf.IDuration|null|undefined} taskTtl - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.taskTtl = null; - - /** - * Queue tombstoneTtl. - * @member {google.protobuf.IDuration|null|undefined} tombstoneTtl - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.tombstoneTtl = null; - - /** - * Queue stackdriverLoggingConfig. - * @member {google.cloud.tasks.v2beta3.IStackdriverLoggingConfig|null|undefined} stackdriverLoggingConfig - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.stackdriverLoggingConfig = null; - - /** - * Queue type. - * @member {google.cloud.tasks.v2beta3.Queue.Type} type - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.type = 0; - - /** - * Queue stats. - * @member {google.cloud.tasks.v2beta3.IQueueStats|null|undefined} stats - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Queue.prototype.stats = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Queue queueType. - * @member {"appEngineHttpQueue"|undefined} queueType - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - */ - Object.defineProperty(Queue.prototype, "queueType", { - get: $util.oneOfGetter($oneOfFields = ["appEngineHttpQueue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Queue instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {google.cloud.tasks.v2beta3.IQueue=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.Queue} Queue instance - */ - Queue.create = function create(properties) { - return new Queue(properties); - }; - - /** - * Encodes the specified Queue message. Does not implicitly {@link google.cloud.tasks.v2beta3.Queue.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {google.cloud.tasks.v2beta3.IQueue} message Queue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Queue.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.appEngineHttpQueue != null && Object.hasOwnProperty.call(message, "appEngineHttpQueue")) - $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue.encode(message.appEngineHttpQueue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.rateLimits != null && Object.hasOwnProperty.call(message, "rateLimits")) - $root.google.cloud.tasks.v2beta3.RateLimits.encode(message.rateLimits, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.retryConfig != null && Object.hasOwnProperty.call(message, "retryConfig")) - $root.google.cloud.tasks.v2beta3.RetryConfig.encode(message.retryConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.purgeTime != null && Object.hasOwnProperty.call(message, "purgeTime")) - $root.google.protobuf.Timestamp.encode(message.purgeTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.taskTtl != null && Object.hasOwnProperty.call(message, "taskTtl")) - $root.google.protobuf.Duration.encode(message.taskTtl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.tombstoneTtl != null && Object.hasOwnProperty.call(message, "tombstoneTtl")) - $root.google.protobuf.Duration.encode(message.tombstoneTtl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.stackdriverLoggingConfig != null && Object.hasOwnProperty.call(message, "stackdriverLoggingConfig")) - $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig.encode(message.stackdriverLoggingConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.type); - if (message.stats != null && Object.hasOwnProperty.call(message, "stats")) - $root.google.cloud.tasks.v2beta3.QueueStats.encode(message.stats, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Queue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.Queue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {google.cloud.tasks.v2beta3.IQueue} message Queue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Queue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Queue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.Queue} Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Queue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.Queue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.appEngineHttpQueue = $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue.decode(reader, reader.uint32()); - break; - } - case 4: { - message.rateLimits = $root.google.cloud.tasks.v2beta3.RateLimits.decode(reader, reader.uint32()); - break; - } - case 5: { - message.retryConfig = $root.google.cloud.tasks.v2beta3.RetryConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.purgeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.taskTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.tombstoneTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 10: { - message.stackdriverLoggingConfig = $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.type = reader.int32(); - break; - } - case 12: { - message.stats = $root.google.cloud.tasks.v2beta3.QueueStats.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Queue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.Queue} Queue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Queue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Queue message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Queue.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.appEngineHttpQueue != null && message.hasOwnProperty("appEngineHttpQueue")) { - properties.queueType = 1; - { - var error = $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue.verify(message.appEngineHttpQueue); - if (error) - return "appEngineHttpQueue." + error; - } - } - if (message.rateLimits != null && message.hasOwnProperty("rateLimits")) { - var error = $root.google.cloud.tasks.v2beta3.RateLimits.verify(message.rateLimits); - if (error) - return "rateLimits." + error; - } - if (message.retryConfig != null && message.hasOwnProperty("retryConfig")) { - var error = $root.google.cloud.tasks.v2beta3.RetryConfig.verify(message.retryConfig); - if (error) - return "retryConfig." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.purgeTime != null && message.hasOwnProperty("purgeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.purgeTime); - if (error) - return "purgeTime." + error; - } - if (message.taskTtl != null && message.hasOwnProperty("taskTtl")) { - var error = $root.google.protobuf.Duration.verify(message.taskTtl); - if (error) - return "taskTtl." + error; - } - if (message.tombstoneTtl != null && message.hasOwnProperty("tombstoneTtl")) { - var error = $root.google.protobuf.Duration.verify(message.tombstoneTtl); - if (error) - return "tombstoneTtl." + error; - } - if (message.stackdriverLoggingConfig != null && message.hasOwnProperty("stackdriverLoggingConfig")) { - var error = $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig.verify(message.stackdriverLoggingConfig); - if (error) - return "stackdriverLoggingConfig." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.stats != null && message.hasOwnProperty("stats")) { - var error = $root.google.cloud.tasks.v2beta3.QueueStats.verify(message.stats); - if (error) - return "stats." + error; - } - return null; - }; - - /** - * Creates a Queue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.Queue} Queue - */ - Queue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.Queue) - return object; - var message = new $root.google.cloud.tasks.v2beta3.Queue(); - if (object.name != null) - message.name = String(object.name); - if (object.appEngineHttpQueue != null) { - if (typeof object.appEngineHttpQueue !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.appEngineHttpQueue: object expected"); - message.appEngineHttpQueue = $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue.fromObject(object.appEngineHttpQueue); - } - if (object.rateLimits != null) { - if (typeof object.rateLimits !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.rateLimits: object expected"); - message.rateLimits = $root.google.cloud.tasks.v2beta3.RateLimits.fromObject(object.rateLimits); - } - if (object.retryConfig != null) { - if (typeof object.retryConfig !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.retryConfig: object expected"); - message.retryConfig = $root.google.cloud.tasks.v2beta3.RetryConfig.fromObject(object.retryConfig); - } - 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 "RUNNING": - case 1: - message.state = 1; - break; - case "PAUSED": - case 2: - message.state = 2; - break; - case "DISABLED": - case 3: - message.state = 3; - break; - } - if (object.purgeTime != null) { - if (typeof object.purgeTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.purgeTime: object expected"); - message.purgeTime = $root.google.protobuf.Timestamp.fromObject(object.purgeTime); - } - if (object.taskTtl != null) { - if (typeof object.taskTtl !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.taskTtl: object expected"); - message.taskTtl = $root.google.protobuf.Duration.fromObject(object.taskTtl); - } - if (object.tombstoneTtl != null) { - if (typeof object.tombstoneTtl !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.tombstoneTtl: object expected"); - message.tombstoneTtl = $root.google.protobuf.Duration.fromObject(object.tombstoneTtl); - } - if (object.stackdriverLoggingConfig != null) { - if (typeof object.stackdriverLoggingConfig !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.stackdriverLoggingConfig: object expected"); - message.stackdriverLoggingConfig = $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig.fromObject(object.stackdriverLoggingConfig); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "PULL": - case 1: - message.type = 1; - break; - case "PUSH": - case 2: - message.type = 2; - break; - } - if (object.stats != null) { - if (typeof object.stats !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Queue.stats: object expected"); - message.stats = $root.google.cloud.tasks.v2beta3.QueueStats.fromObject(object.stats); - } - return message; - }; - - /** - * Creates a plain object from a Queue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {google.cloud.tasks.v2beta3.Queue} message Queue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Queue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.rateLimits = null; - object.retryConfig = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.purgeTime = null; - object.taskTtl = null; - object.tombstoneTtl = null; - object.stackdriverLoggingConfig = null; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.stats = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appEngineHttpQueue != null && message.hasOwnProperty("appEngineHttpQueue")) { - object.appEngineHttpQueue = $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue.toObject(message.appEngineHttpQueue, options); - if (options.oneofs) - object.queueType = "appEngineHttpQueue"; - } - if (message.rateLimits != null && message.hasOwnProperty("rateLimits")) - object.rateLimits = $root.google.cloud.tasks.v2beta3.RateLimits.toObject(message.rateLimits, options); - if (message.retryConfig != null && message.hasOwnProperty("retryConfig")) - object.retryConfig = $root.google.cloud.tasks.v2beta3.RetryConfig.toObject(message.retryConfig, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.tasks.v2beta3.Queue.State[message.state] === undefined ? message.state : $root.google.cloud.tasks.v2beta3.Queue.State[message.state] : message.state; - if (message.purgeTime != null && message.hasOwnProperty("purgeTime")) - object.purgeTime = $root.google.protobuf.Timestamp.toObject(message.purgeTime, options); - if (message.taskTtl != null && message.hasOwnProperty("taskTtl")) - object.taskTtl = $root.google.protobuf.Duration.toObject(message.taskTtl, options); - if (message.tombstoneTtl != null && message.hasOwnProperty("tombstoneTtl")) - object.tombstoneTtl = $root.google.protobuf.Duration.toObject(message.tombstoneTtl, options); - if (message.stackdriverLoggingConfig != null && message.hasOwnProperty("stackdriverLoggingConfig")) - object.stackdriverLoggingConfig = $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig.toObject(message.stackdriverLoggingConfig, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.tasks.v2beta3.Queue.Type[message.type] === undefined ? message.type : $root.google.cloud.tasks.v2beta3.Queue.Type[message.type] : message.type; - if (message.stats != null && message.hasOwnProperty("stats")) - object.stats = $root.google.cloud.tasks.v2beta3.QueueStats.toObject(message.stats, options); - return object; - }; - - /** - * Converts this Queue to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.Queue - * @instance - * @returns {Object.} JSON object - */ - Queue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Queue - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.Queue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Queue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.Queue"; - }; - - /** - * State enum. - * @name google.cloud.tasks.v2beta3.Queue.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} PAUSED=2 PAUSED value - * @property {number} DISABLED=3 DISABLED value - */ - Queue.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "DISABLED"] = 3; - return values; - })(); - - /** - * Type enum. - * @name google.cloud.tasks.v2beta3.Queue.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} PULL=1 PULL value - * @property {number} PUSH=2 PUSH value - */ - Queue.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PULL"] = 1; - values[valuesById[2] = "PUSH"] = 2; - return values; - })(); - - return Queue; - })(); - - v2beta3.RateLimits = (function() { - - /** - * Properties of a RateLimits. - * @memberof google.cloud.tasks.v2beta3 - * @interface IRateLimits - * @property {number|null} [maxDispatchesPerSecond] RateLimits maxDispatchesPerSecond - * @property {number|null} [maxBurstSize] RateLimits maxBurstSize - * @property {number|null} [maxConcurrentDispatches] RateLimits maxConcurrentDispatches - */ - - /** - * Constructs a new RateLimits. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a RateLimits. - * @implements IRateLimits - * @constructor - * @param {google.cloud.tasks.v2beta3.IRateLimits=} [properties] Properties to set - */ - function RateLimits(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RateLimits maxDispatchesPerSecond. - * @member {number} maxDispatchesPerSecond - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @instance - */ - RateLimits.prototype.maxDispatchesPerSecond = 0; - - /** - * RateLimits maxBurstSize. - * @member {number} maxBurstSize - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @instance - */ - RateLimits.prototype.maxBurstSize = 0; - - /** - * RateLimits maxConcurrentDispatches. - * @member {number} maxConcurrentDispatches - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @instance - */ - RateLimits.prototype.maxConcurrentDispatches = 0; - - /** - * Creates a new RateLimits instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {google.cloud.tasks.v2beta3.IRateLimits=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.RateLimits} RateLimits instance - */ - RateLimits.create = function create(properties) { - return new RateLimits(properties); - }; - - /** - * Encodes the specified RateLimits message. Does not implicitly {@link google.cloud.tasks.v2beta3.RateLimits.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {google.cloud.tasks.v2beta3.IRateLimits} message RateLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateLimits.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxDispatchesPerSecond != null && Object.hasOwnProperty.call(message, "maxDispatchesPerSecond")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.maxDispatchesPerSecond); - if (message.maxBurstSize != null && Object.hasOwnProperty.call(message, "maxBurstSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxBurstSize); - if (message.maxConcurrentDispatches != null && Object.hasOwnProperty.call(message, "maxConcurrentDispatches")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxConcurrentDispatches); - return writer; - }; - - /** - * Encodes the specified RateLimits message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.RateLimits.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {google.cloud.tasks.v2beta3.IRateLimits} message RateLimits message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RateLimits.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RateLimits message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.RateLimits} RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateLimits.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.RateLimits(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxDispatchesPerSecond = reader.double(); - break; - } - case 2: { - message.maxBurstSize = reader.int32(); - break; - } - case 3: { - message.maxConcurrentDispatches = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RateLimits message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.RateLimits} RateLimits - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RateLimits.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RateLimits message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RateLimits.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxDispatchesPerSecond != null && message.hasOwnProperty("maxDispatchesPerSecond")) - if (typeof message.maxDispatchesPerSecond !== "number") - return "maxDispatchesPerSecond: number expected"; - if (message.maxBurstSize != null && message.hasOwnProperty("maxBurstSize")) - if (!$util.isInteger(message.maxBurstSize)) - return "maxBurstSize: integer expected"; - if (message.maxConcurrentDispatches != null && message.hasOwnProperty("maxConcurrentDispatches")) - if (!$util.isInteger(message.maxConcurrentDispatches)) - return "maxConcurrentDispatches: integer expected"; - return null; - }; - - /** - * Creates a RateLimits message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.RateLimits} RateLimits - */ - RateLimits.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.RateLimits) - return object; - var message = new $root.google.cloud.tasks.v2beta3.RateLimits(); - if (object.maxDispatchesPerSecond != null) - message.maxDispatchesPerSecond = Number(object.maxDispatchesPerSecond); - if (object.maxBurstSize != null) - message.maxBurstSize = object.maxBurstSize | 0; - if (object.maxConcurrentDispatches != null) - message.maxConcurrentDispatches = object.maxConcurrentDispatches | 0; - return message; - }; - - /** - * Creates a plain object from a RateLimits message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {google.cloud.tasks.v2beta3.RateLimits} message RateLimits - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RateLimits.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxDispatchesPerSecond = 0; - object.maxBurstSize = 0; - object.maxConcurrentDispatches = 0; - } - if (message.maxDispatchesPerSecond != null && message.hasOwnProperty("maxDispatchesPerSecond")) - object.maxDispatchesPerSecond = options.json && !isFinite(message.maxDispatchesPerSecond) ? String(message.maxDispatchesPerSecond) : message.maxDispatchesPerSecond; - if (message.maxBurstSize != null && message.hasOwnProperty("maxBurstSize")) - object.maxBurstSize = message.maxBurstSize; - if (message.maxConcurrentDispatches != null && message.hasOwnProperty("maxConcurrentDispatches")) - object.maxConcurrentDispatches = message.maxConcurrentDispatches; - return object; - }; - - /** - * Converts this RateLimits to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @instance - * @returns {Object.} JSON object - */ - RateLimits.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RateLimits - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.RateLimits - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RateLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.RateLimits"; - }; - - return RateLimits; - })(); - - v2beta3.RetryConfig = (function() { - - /** - * Properties of a RetryConfig. - * @memberof google.cloud.tasks.v2beta3 - * @interface IRetryConfig - * @property {number|null} [maxAttempts] RetryConfig maxAttempts - * @property {google.protobuf.IDuration|null} [maxRetryDuration] RetryConfig maxRetryDuration - * @property {google.protobuf.IDuration|null} [minBackoff] RetryConfig minBackoff - * @property {google.protobuf.IDuration|null} [maxBackoff] RetryConfig maxBackoff - * @property {number|null} [maxDoublings] RetryConfig maxDoublings - */ - - /** - * Constructs a new RetryConfig. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a RetryConfig. - * @implements IRetryConfig - * @constructor - * @param {google.cloud.tasks.v2beta3.IRetryConfig=} [properties] Properties to set - */ - function RetryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RetryConfig maxAttempts. - * @member {number} maxAttempts - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @instance - */ - RetryConfig.prototype.maxAttempts = 0; - - /** - * RetryConfig maxRetryDuration. - * @member {google.protobuf.IDuration|null|undefined} maxRetryDuration - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @instance - */ - RetryConfig.prototype.maxRetryDuration = null; - - /** - * RetryConfig minBackoff. - * @member {google.protobuf.IDuration|null|undefined} minBackoff - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @instance - */ - RetryConfig.prototype.minBackoff = null; - - /** - * RetryConfig maxBackoff. - * @member {google.protobuf.IDuration|null|undefined} maxBackoff - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @instance - */ - RetryConfig.prototype.maxBackoff = null; - - /** - * RetryConfig maxDoublings. - * @member {number} maxDoublings - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @instance - */ - RetryConfig.prototype.maxDoublings = 0; - - /** - * Creates a new RetryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta3.IRetryConfig=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.RetryConfig} RetryConfig instance - */ - RetryConfig.create = function create(properties) { - return new RetryConfig(properties); - }; - - /** - * Encodes the specified RetryConfig message. Does not implicitly {@link google.cloud.tasks.v2beta3.RetryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta3.IRetryConfig} message RetryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxAttempts != null && Object.hasOwnProperty.call(message, "maxAttempts")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxAttempts); - if (message.maxRetryDuration != null && Object.hasOwnProperty.call(message, "maxRetryDuration")) - $root.google.protobuf.Duration.encode(message.maxRetryDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.minBackoff != null && Object.hasOwnProperty.call(message, "minBackoff")) - $root.google.protobuf.Duration.encode(message.minBackoff, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maxBackoff != null && Object.hasOwnProperty.call(message, "maxBackoff")) - $root.google.protobuf.Duration.encode(message.maxBackoff, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.maxDoublings != null && Object.hasOwnProperty.call(message, "maxDoublings")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxDoublings); - return writer; - }; - - /** - * Encodes the specified RetryConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.RetryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta3.IRetryConfig} message RetryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RetryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RetryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.RetryConfig} RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.RetryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxAttempts = reader.int32(); - break; - } - case 2: { - message.maxRetryDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 3: { - message.minBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.maxBackoff = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.maxDoublings = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RetryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.RetryConfig} RetryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RetryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RetryConfig message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RetryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxAttempts != null && message.hasOwnProperty("maxAttempts")) - if (!$util.isInteger(message.maxAttempts)) - return "maxAttempts: integer expected"; - if (message.maxRetryDuration != null && message.hasOwnProperty("maxRetryDuration")) { - var error = $root.google.protobuf.Duration.verify(message.maxRetryDuration); - if (error) - return "maxRetryDuration." + error; - } - if (message.minBackoff != null && message.hasOwnProperty("minBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.minBackoff); - if (error) - return "minBackoff." + error; - } - if (message.maxBackoff != null && message.hasOwnProperty("maxBackoff")) { - var error = $root.google.protobuf.Duration.verify(message.maxBackoff); - if (error) - return "maxBackoff." + error; - } - if (message.maxDoublings != null && message.hasOwnProperty("maxDoublings")) - if (!$util.isInteger(message.maxDoublings)) - return "maxDoublings: integer expected"; - return null; - }; - - /** - * Creates a RetryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.RetryConfig} RetryConfig - */ - RetryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.RetryConfig) - return object; - var message = new $root.google.cloud.tasks.v2beta3.RetryConfig(); - if (object.maxAttempts != null) - message.maxAttempts = object.maxAttempts | 0; - if (object.maxRetryDuration != null) { - if (typeof object.maxRetryDuration !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.RetryConfig.maxRetryDuration: object expected"); - message.maxRetryDuration = $root.google.protobuf.Duration.fromObject(object.maxRetryDuration); - } - if (object.minBackoff != null) { - if (typeof object.minBackoff !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.RetryConfig.minBackoff: object expected"); - message.minBackoff = $root.google.protobuf.Duration.fromObject(object.minBackoff); - } - if (object.maxBackoff != null) { - if (typeof object.maxBackoff !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.RetryConfig.maxBackoff: object expected"); - message.maxBackoff = $root.google.protobuf.Duration.fromObject(object.maxBackoff); - } - if (object.maxDoublings != null) - message.maxDoublings = object.maxDoublings | 0; - return message; - }; - - /** - * Creates a plain object from a RetryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {google.cloud.tasks.v2beta3.RetryConfig} message RetryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RetryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxAttempts = 0; - object.maxRetryDuration = null; - object.minBackoff = null; - object.maxBackoff = null; - object.maxDoublings = 0; - } - if (message.maxAttempts != null && message.hasOwnProperty("maxAttempts")) - object.maxAttempts = message.maxAttempts; - if (message.maxRetryDuration != null && message.hasOwnProperty("maxRetryDuration")) - object.maxRetryDuration = $root.google.protobuf.Duration.toObject(message.maxRetryDuration, options); - if (message.minBackoff != null && message.hasOwnProperty("minBackoff")) - object.minBackoff = $root.google.protobuf.Duration.toObject(message.minBackoff, options); - if (message.maxBackoff != null && message.hasOwnProperty("maxBackoff")) - object.maxBackoff = $root.google.protobuf.Duration.toObject(message.maxBackoff, options); - if (message.maxDoublings != null && message.hasOwnProperty("maxDoublings")) - object.maxDoublings = message.maxDoublings; - return object; - }; - - /** - * Converts this RetryConfig to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @instance - * @returns {Object.} JSON object - */ - RetryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RetryConfig - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.RetryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RetryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.RetryConfig"; - }; - - return RetryConfig; - })(); - - v2beta3.StackdriverLoggingConfig = (function() { - - /** - * Properties of a StackdriverLoggingConfig. - * @memberof google.cloud.tasks.v2beta3 - * @interface IStackdriverLoggingConfig - * @property {number|null} [samplingRatio] StackdriverLoggingConfig samplingRatio - */ - - /** - * Constructs a new StackdriverLoggingConfig. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a StackdriverLoggingConfig. - * @implements IStackdriverLoggingConfig - * @constructor - * @param {google.cloud.tasks.v2beta3.IStackdriverLoggingConfig=} [properties] Properties to set - */ - function StackdriverLoggingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StackdriverLoggingConfig samplingRatio. - * @member {number} samplingRatio - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @instance - */ - StackdriverLoggingConfig.prototype.samplingRatio = 0; - - /** - * Creates a new StackdriverLoggingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2beta3.IStackdriverLoggingConfig=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.StackdriverLoggingConfig} StackdriverLoggingConfig instance - */ - StackdriverLoggingConfig.create = function create(properties) { - return new StackdriverLoggingConfig(properties); - }; - - /** - * Encodes the specified StackdriverLoggingConfig message. Does not implicitly {@link google.cloud.tasks.v2beta3.StackdriverLoggingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2beta3.IStackdriverLoggingConfig} message StackdriverLoggingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StackdriverLoggingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.samplingRatio != null && Object.hasOwnProperty.call(message, "samplingRatio")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.samplingRatio); - return writer; - }; - - /** - * Encodes the specified StackdriverLoggingConfig message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.StackdriverLoggingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2beta3.IStackdriverLoggingConfig} message StackdriverLoggingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StackdriverLoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.StackdriverLoggingConfig} StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StackdriverLoggingConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.samplingRatio = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StackdriverLoggingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.StackdriverLoggingConfig} StackdriverLoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StackdriverLoggingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StackdriverLoggingConfig message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StackdriverLoggingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.samplingRatio != null && message.hasOwnProperty("samplingRatio")) - if (typeof message.samplingRatio !== "number") - return "samplingRatio: number expected"; - return null; - }; - - /** - * Creates a StackdriverLoggingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.StackdriverLoggingConfig} StackdriverLoggingConfig - */ - StackdriverLoggingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig) - return object; - var message = new $root.google.cloud.tasks.v2beta3.StackdriverLoggingConfig(); - if (object.samplingRatio != null) - message.samplingRatio = Number(object.samplingRatio); - return message; - }; - - /** - * Creates a plain object from a StackdriverLoggingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {google.cloud.tasks.v2beta3.StackdriverLoggingConfig} message StackdriverLoggingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StackdriverLoggingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.samplingRatio = 0; - if (message.samplingRatio != null && message.hasOwnProperty("samplingRatio")) - object.samplingRatio = options.json && !isFinite(message.samplingRatio) ? String(message.samplingRatio) : message.samplingRatio; - return object; - }; - - /** - * Converts this StackdriverLoggingConfig to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @instance - * @returns {Object.} JSON object - */ - StackdriverLoggingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StackdriverLoggingConfig - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.StackdriverLoggingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StackdriverLoggingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.StackdriverLoggingConfig"; - }; - - return StackdriverLoggingConfig; - })(); - - v2beta3.QueueStats = (function() { - - /** - * Properties of a QueueStats. - * @memberof google.cloud.tasks.v2beta3 - * @interface IQueueStats - * @property {number|Long|null} [tasksCount] QueueStats tasksCount - * @property {google.protobuf.ITimestamp|null} [oldestEstimatedArrivalTime] QueueStats oldestEstimatedArrivalTime - * @property {number|Long|null} [executedLastMinuteCount] QueueStats executedLastMinuteCount - * @property {number|Long|null} [concurrentDispatchesCount] QueueStats concurrentDispatchesCount - * @property {number|null} [effectiveExecutionRate] QueueStats effectiveExecutionRate - */ - - /** - * Constructs a new QueueStats. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a QueueStats. - * @implements IQueueStats - * @constructor - * @param {google.cloud.tasks.v2beta3.IQueueStats=} [properties] Properties to set - */ - function QueueStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueueStats tasksCount. - * @member {number|Long} tasksCount - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @instance - */ - QueueStats.prototype.tasksCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueueStats oldestEstimatedArrivalTime. - * @member {google.protobuf.ITimestamp|null|undefined} oldestEstimatedArrivalTime - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @instance - */ - QueueStats.prototype.oldestEstimatedArrivalTime = null; - - /** - * QueueStats executedLastMinuteCount. - * @member {number|Long} executedLastMinuteCount - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @instance - */ - QueueStats.prototype.executedLastMinuteCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueueStats concurrentDispatchesCount. - * @member {number|Long} concurrentDispatchesCount - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @instance - */ - QueueStats.prototype.concurrentDispatchesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueueStats effectiveExecutionRate. - * @member {number} effectiveExecutionRate - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @instance - */ - QueueStats.prototype.effectiveExecutionRate = 0; - - /** - * Creates a new QueueStats instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {google.cloud.tasks.v2beta3.IQueueStats=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.QueueStats} QueueStats instance - */ - QueueStats.create = function create(properties) { - return new QueueStats(properties); - }; - - /** - * Encodes the specified QueueStats message. Does not implicitly {@link google.cloud.tasks.v2beta3.QueueStats.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {google.cloud.tasks.v2beta3.IQueueStats} message QueueStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueueStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tasksCount != null && Object.hasOwnProperty.call(message, "tasksCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.tasksCount); - if (message.oldestEstimatedArrivalTime != null && Object.hasOwnProperty.call(message, "oldestEstimatedArrivalTime")) - $root.google.protobuf.Timestamp.encode(message.oldestEstimatedArrivalTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.executedLastMinuteCount != null && Object.hasOwnProperty.call(message, "executedLastMinuteCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.executedLastMinuteCount); - if (message.concurrentDispatchesCount != null && Object.hasOwnProperty.call(message, "concurrentDispatchesCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.concurrentDispatchesCount); - if (message.effectiveExecutionRate != null && Object.hasOwnProperty.call(message, "effectiveExecutionRate")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.effectiveExecutionRate); - return writer; - }; - - /** - * Encodes the specified QueueStats message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.QueueStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {google.cloud.tasks.v2beta3.IQueueStats} message QueueStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueueStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueueStats message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.QueueStats} QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueueStats.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.QueueStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.tasksCount = reader.int64(); - break; - } - case 2: { - message.oldestEstimatedArrivalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.executedLastMinuteCount = reader.int64(); - break; - } - case 4: { - message.concurrentDispatchesCount = reader.int64(); - break; - } - case 5: { - message.effectiveExecutionRate = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueueStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.QueueStats} QueueStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueueStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueueStats message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueueStats.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tasksCount != null && message.hasOwnProperty("tasksCount")) - if (!$util.isInteger(message.tasksCount) && !(message.tasksCount && $util.isInteger(message.tasksCount.low) && $util.isInteger(message.tasksCount.high))) - return "tasksCount: integer|Long expected"; - if (message.oldestEstimatedArrivalTime != null && message.hasOwnProperty("oldestEstimatedArrivalTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.oldestEstimatedArrivalTime); - if (error) - return "oldestEstimatedArrivalTime." + error; - } - if (message.executedLastMinuteCount != null && message.hasOwnProperty("executedLastMinuteCount")) - if (!$util.isInteger(message.executedLastMinuteCount) && !(message.executedLastMinuteCount && $util.isInteger(message.executedLastMinuteCount.low) && $util.isInteger(message.executedLastMinuteCount.high))) - return "executedLastMinuteCount: integer|Long expected"; - if (message.concurrentDispatchesCount != null && message.hasOwnProperty("concurrentDispatchesCount")) - if (!$util.isInteger(message.concurrentDispatchesCount) && !(message.concurrentDispatchesCount && $util.isInteger(message.concurrentDispatchesCount.low) && $util.isInteger(message.concurrentDispatchesCount.high))) - return "concurrentDispatchesCount: integer|Long expected"; - if (message.effectiveExecutionRate != null && message.hasOwnProperty("effectiveExecutionRate")) - if (typeof message.effectiveExecutionRate !== "number") - return "effectiveExecutionRate: number expected"; - return null; - }; - - /** - * Creates a QueueStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.QueueStats} QueueStats - */ - QueueStats.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.QueueStats) - return object; - var message = new $root.google.cloud.tasks.v2beta3.QueueStats(); - if (object.tasksCount != null) - if ($util.Long) - (message.tasksCount = $util.Long.fromValue(object.tasksCount)).unsigned = false; - else if (typeof object.tasksCount === "string") - message.tasksCount = parseInt(object.tasksCount, 10); - else if (typeof object.tasksCount === "number") - message.tasksCount = object.tasksCount; - else if (typeof object.tasksCount === "object") - message.tasksCount = new $util.LongBits(object.tasksCount.low >>> 0, object.tasksCount.high >>> 0).toNumber(); - if (object.oldestEstimatedArrivalTime != null) { - if (typeof object.oldestEstimatedArrivalTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.QueueStats.oldestEstimatedArrivalTime: object expected"); - message.oldestEstimatedArrivalTime = $root.google.protobuf.Timestamp.fromObject(object.oldestEstimatedArrivalTime); - } - if (object.executedLastMinuteCount != null) - if ($util.Long) - (message.executedLastMinuteCount = $util.Long.fromValue(object.executedLastMinuteCount)).unsigned = false; - else if (typeof object.executedLastMinuteCount === "string") - message.executedLastMinuteCount = parseInt(object.executedLastMinuteCount, 10); - else if (typeof object.executedLastMinuteCount === "number") - message.executedLastMinuteCount = object.executedLastMinuteCount; - else if (typeof object.executedLastMinuteCount === "object") - message.executedLastMinuteCount = new $util.LongBits(object.executedLastMinuteCount.low >>> 0, object.executedLastMinuteCount.high >>> 0).toNumber(); - if (object.concurrentDispatchesCount != null) - if ($util.Long) - (message.concurrentDispatchesCount = $util.Long.fromValue(object.concurrentDispatchesCount)).unsigned = false; - else if (typeof object.concurrentDispatchesCount === "string") - message.concurrentDispatchesCount = parseInt(object.concurrentDispatchesCount, 10); - else if (typeof object.concurrentDispatchesCount === "number") - message.concurrentDispatchesCount = object.concurrentDispatchesCount; - else if (typeof object.concurrentDispatchesCount === "object") - message.concurrentDispatchesCount = new $util.LongBits(object.concurrentDispatchesCount.low >>> 0, object.concurrentDispatchesCount.high >>> 0).toNumber(); - if (object.effectiveExecutionRate != null) - message.effectiveExecutionRate = Number(object.effectiveExecutionRate); - return message; - }; - - /** - * Creates a plain object from a QueueStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {google.cloud.tasks.v2beta3.QueueStats} message QueueStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueueStats.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.tasksCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tasksCount = options.longs === String ? "0" : 0; - object.oldestEstimatedArrivalTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.executedLastMinuteCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.executedLastMinuteCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.concurrentDispatchesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.concurrentDispatchesCount = options.longs === String ? "0" : 0; - object.effectiveExecutionRate = 0; - } - if (message.tasksCount != null && message.hasOwnProperty("tasksCount")) - if (typeof message.tasksCount === "number") - object.tasksCount = options.longs === String ? String(message.tasksCount) : message.tasksCount; - else - object.tasksCount = options.longs === String ? $util.Long.prototype.toString.call(message.tasksCount) : options.longs === Number ? new $util.LongBits(message.tasksCount.low >>> 0, message.tasksCount.high >>> 0).toNumber() : message.tasksCount; - if (message.oldestEstimatedArrivalTime != null && message.hasOwnProperty("oldestEstimatedArrivalTime")) - object.oldestEstimatedArrivalTime = $root.google.protobuf.Timestamp.toObject(message.oldestEstimatedArrivalTime, options); - if (message.executedLastMinuteCount != null && message.hasOwnProperty("executedLastMinuteCount")) - if (typeof message.executedLastMinuteCount === "number") - object.executedLastMinuteCount = options.longs === String ? String(message.executedLastMinuteCount) : message.executedLastMinuteCount; - else - object.executedLastMinuteCount = options.longs === String ? $util.Long.prototype.toString.call(message.executedLastMinuteCount) : options.longs === Number ? new $util.LongBits(message.executedLastMinuteCount.low >>> 0, message.executedLastMinuteCount.high >>> 0).toNumber() : message.executedLastMinuteCount; - if (message.concurrentDispatchesCount != null && message.hasOwnProperty("concurrentDispatchesCount")) - if (typeof message.concurrentDispatchesCount === "number") - object.concurrentDispatchesCount = options.longs === String ? String(message.concurrentDispatchesCount) : message.concurrentDispatchesCount; - else - object.concurrentDispatchesCount = options.longs === String ? $util.Long.prototype.toString.call(message.concurrentDispatchesCount) : options.longs === Number ? new $util.LongBits(message.concurrentDispatchesCount.low >>> 0, message.concurrentDispatchesCount.high >>> 0).toNumber() : message.concurrentDispatchesCount; - if (message.effectiveExecutionRate != null && message.hasOwnProperty("effectiveExecutionRate")) - object.effectiveExecutionRate = options.json && !isFinite(message.effectiveExecutionRate) ? String(message.effectiveExecutionRate) : message.effectiveExecutionRate; - return object; - }; - - /** - * Converts this QueueStats to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @instance - * @returns {Object.} JSON object - */ - QueueStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueueStats - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.QueueStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueueStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.QueueStats"; - }; - - return QueueStats; - })(); - - v2beta3.PullMessage = (function() { - - /** - * Properties of a PullMessage. - * @memberof google.cloud.tasks.v2beta3 - * @interface IPullMessage - * @property {Uint8Array|null} [payload] PullMessage payload - * @property {string|null} [tag] PullMessage tag - */ - - /** - * Constructs a new PullMessage. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a PullMessage. - * @implements IPullMessage - * @constructor - * @param {google.cloud.tasks.v2beta3.IPullMessage=} [properties] Properties to set - */ - function PullMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PullMessage payload. - * @member {Uint8Array} payload - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @instance - */ - PullMessage.prototype.payload = $util.newBuffer([]); - - /** - * PullMessage tag. - * @member {string} tag - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @instance - */ - PullMessage.prototype.tag = ""; - - /** - * Creates a new PullMessage instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {google.cloud.tasks.v2beta3.IPullMessage=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.PullMessage} PullMessage instance - */ - PullMessage.create = function create(properties) { - return new PullMessage(properties); - }; - - /** - * Encodes the specified PullMessage message. Does not implicitly {@link google.cloud.tasks.v2beta3.PullMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {google.cloud.tasks.v2beta3.IPullMessage} message PullMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payload); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); - return writer; - }; - - /** - * Encodes the specified PullMessage message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.PullMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {google.cloud.tasks.v2beta3.IPullMessage} message PullMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PullMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PullMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.PullMessage} PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.PullMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.payload = reader.bytes(); - break; - } - case 2: { - message.tag = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PullMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.PullMessage} PullMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PullMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PullMessage message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PullMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.payload != null && message.hasOwnProperty("payload")) - if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) - return "payload: buffer expected"; - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; - return null; - }; - - /** - * Creates a PullMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.PullMessage} PullMessage - */ - PullMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.PullMessage) - return object; - var message = new $root.google.cloud.tasks.v2beta3.PullMessage(); - if (object.payload != null) - if (typeof object.payload === "string") - $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length >= 0) - message.payload = object.payload; - if (object.tag != null) - message.tag = String(object.tag); - return message; - }; - - /** - * Creates a plain object from a PullMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {google.cloud.tasks.v2beta3.PullMessage} message PullMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PullMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.payload = ""; - else { - object.payload = []; - if (options.bytes !== Array) - object.payload = $util.newBuffer(object.payload); - } - object.tag = ""; - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; - return object; - }; - - /** - * Converts this PullMessage to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @instance - * @returns {Object.} JSON object - */ - PullMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PullMessage - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.PullMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PullMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.PullMessage"; - }; - - return PullMessage; - })(); - - v2beta3.HttpRequest = (function() { - - /** - * Properties of a HttpRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IHttpRequest - * @property {string|null} [url] HttpRequest url - * @property {google.cloud.tasks.v2beta3.HttpMethod|null} [httpMethod] HttpRequest httpMethod - * @property {Object.|null} [headers] HttpRequest headers - * @property {Uint8Array|null} [body] HttpRequest body - * @property {google.cloud.tasks.v2beta3.IOAuthToken|null} [oauthToken] HttpRequest oauthToken - * @property {google.cloud.tasks.v2beta3.IOidcToken|null} [oidcToken] HttpRequest oidcToken - */ - - /** - * Constructs a new HttpRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a HttpRequest. - * @implements IHttpRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IHttpRequest=} [properties] Properties to set - */ - function HttpRequest(properties) { - this.headers = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRequest url. - * @member {string} url - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - HttpRequest.prototype.url = ""; - - /** - * HttpRequest httpMethod. - * @member {google.cloud.tasks.v2beta3.HttpMethod} httpMethod - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - HttpRequest.prototype.httpMethod = 0; - - /** - * HttpRequest headers. - * @member {Object.} headers - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - HttpRequest.prototype.headers = $util.emptyObject; - - /** - * HttpRequest body. - * @member {Uint8Array} body - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - HttpRequest.prototype.body = $util.newBuffer([]); - - /** - * HttpRequest oauthToken. - * @member {google.cloud.tasks.v2beta3.IOAuthToken|null|undefined} oauthToken - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - HttpRequest.prototype.oauthToken = null; - - /** - * HttpRequest oidcToken. - * @member {google.cloud.tasks.v2beta3.IOidcToken|null|undefined} oidcToken - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - HttpRequest.prototype.oidcToken = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRequest authorizationHeader. - * @member {"oauthToken"|"oidcToken"|undefined} authorizationHeader - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - */ - Object.defineProperty(HttpRequest.prototype, "authorizationHeader", { - get: $util.oneOfGetter($oneOfFields = ["oauthToken", "oidcToken"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.IHttpRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.HttpRequest} HttpRequest instance - */ - HttpRequest.create = function create(properties) { - return new HttpRequest(properties); - }; - - /** - * Encodes the specified HttpRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.HttpRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.IHttpRequest} message HttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.httpMethod); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.body); - if (message.oauthToken != null && Object.hasOwnProperty.call(message, "oauthToken")) - $root.google.cloud.tasks.v2beta3.OAuthToken.encode(message.oauthToken, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.oidcToken != null && Object.hasOwnProperty.call(message, "oidcToken")) - $root.google.cloud.tasks.v2beta3.OidcToken.encode(message.oidcToken, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.HttpRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.IHttpRequest} message HttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.HttpRequest} HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.HttpRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.url = reader.string(); - break; - } - case 2: { - message.httpMethod = reader.int32(); - break; - } - case 3: { - if (message.headers === $util.emptyObject) - message.headers = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.headers[key] = value; - break; - } - case 4: { - message.body = reader.bytes(); - break; - } - case 5: { - message.oauthToken = $root.google.cloud.tasks.v2beta3.OAuthToken.decode(reader, reader.uint32()); - break; - } - case 6: { - message.oidcToken = $root.google.cloud.tasks.v2beta3.OidcToken.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.HttpRequest} HttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - switch (message.httpMethod) { - default: - return "httpMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; - } - if (message.body != null && message.hasOwnProperty("body")) - if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body))) - return "body: buffer expected"; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) { - properties.authorizationHeader = 1; - { - var error = $root.google.cloud.tasks.v2beta3.OAuthToken.verify(message.oauthToken); - if (error) - return "oauthToken." + error; - } - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - if (properties.authorizationHeader === 1) - return "authorizationHeader: multiple values"; - properties.authorizationHeader = 1; - { - var error = $root.google.cloud.tasks.v2beta3.OidcToken.verify(message.oidcToken); - if (error) - return "oidcToken." + error; - } - } - return null; - }; - - /** - * Creates a HttpRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.HttpRequest} HttpRequest - */ - HttpRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.HttpRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.HttpRequest(); - if (object.url != null) - message.url = String(object.url); - switch (object.httpMethod) { - default: - if (typeof object.httpMethod === "number") { - message.httpMethod = object.httpMethod; - break; - } - break; - case "HTTP_METHOD_UNSPECIFIED": - case 0: - message.httpMethod = 0; - break; - case "POST": - case 1: - message.httpMethod = 1; - break; - case "GET": - case 2: - message.httpMethod = 2; - break; - case "HEAD": - case 3: - message.httpMethod = 3; - break; - case "PUT": - case 4: - message.httpMethod = 4; - break; - case "DELETE": - case 5: - message.httpMethod = 5; - break; - case "PATCH": - case 6: - message.httpMethod = 6; - break; - case "OPTIONS": - case 7: - message.httpMethod = 7; - break; - } - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.HttpRequest.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); - } - if (object.body != null) - if (typeof object.body === "string") - $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0); - else if (object.body.length >= 0) - message.body = object.body; - if (object.oauthToken != null) { - if (typeof object.oauthToken !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.HttpRequest.oauthToken: object expected"); - message.oauthToken = $root.google.cloud.tasks.v2beta3.OAuthToken.fromObject(object.oauthToken); - } - if (object.oidcToken != null) { - if (typeof object.oidcToken !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.HttpRequest.oidcToken: object expected"); - message.oidcToken = $root.google.cloud.tasks.v2beta3.OidcToken.fromObject(object.oidcToken); - } - return message; - }; - - /** - * Creates a plain object from a HttpRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.HttpRequest} message HttpRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.headers = {}; - if (options.defaults) { - object.url = ""; - object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; - if (options.bytes === String) - object.body = ""; - else { - object.body = []; - if (options.bytes !== Array) - object.body = $util.newBuffer(object.body); - } - } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - object.httpMethod = options.enums === String ? $root.google.cloud.tasks.v2beta3.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.tasks.v2beta3.HttpMethod[message.httpMethod] : message.httpMethod; - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body; - if (message.oauthToken != null && message.hasOwnProperty("oauthToken")) { - object.oauthToken = $root.google.cloud.tasks.v2beta3.OAuthToken.toObject(message.oauthToken, options); - if (options.oneofs) - object.authorizationHeader = "oauthToken"; - } - if (message.oidcToken != null && message.hasOwnProperty("oidcToken")) { - object.oidcToken = $root.google.cloud.tasks.v2beta3.OidcToken.toObject(message.oidcToken, options); - if (options.oneofs) - object.authorizationHeader = "oidcToken"; - } - return object; - }; - - /** - * Converts this HttpRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @instance - * @returns {Object.} JSON object - */ - HttpRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.HttpRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.HttpRequest"; - }; - - return HttpRequest; - })(); - - v2beta3.AppEngineHttpQueue = (function() { - - /** - * Properties of an AppEngineHttpQueue. - * @memberof google.cloud.tasks.v2beta3 - * @interface IAppEngineHttpQueue - * @property {google.cloud.tasks.v2beta3.IAppEngineRouting|null} [appEngineRoutingOverride] AppEngineHttpQueue appEngineRoutingOverride - */ - - /** - * Constructs a new AppEngineHttpQueue. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents an AppEngineHttpQueue. - * @implements IAppEngineHttpQueue - * @constructor - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpQueue=} [properties] Properties to set - */ - function AppEngineHttpQueue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineHttpQueue appEngineRoutingOverride. - * @member {google.cloud.tasks.v2beta3.IAppEngineRouting|null|undefined} appEngineRoutingOverride - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @instance - */ - AppEngineHttpQueue.prototype.appEngineRoutingOverride = null; - - /** - * Creates a new AppEngineHttpQueue instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpQueue=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpQueue} AppEngineHttpQueue instance - */ - AppEngineHttpQueue.create = function create(properties) { - return new AppEngineHttpQueue(properties); - }; - - /** - * Encodes the specified AppEngineHttpQueue message. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpQueue.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpQueue} message AppEngineHttpQueue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpQueue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.appEngineRoutingOverride != null && Object.hasOwnProperty.call(message, "appEngineRoutingOverride")) - $root.google.cloud.tasks.v2beta3.AppEngineRouting.encode(message.appEngineRoutingOverride, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AppEngineHttpQueue message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpQueue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpQueue} message AppEngineHttpQueue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpQueue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineHttpQueue message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpQueue} AppEngineHttpQueue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpQueue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.appEngineRoutingOverride = $root.google.cloud.tasks.v2beta3.AppEngineRouting.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineHttpQueue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpQueue} AppEngineHttpQueue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpQueue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineHttpQueue message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineHttpQueue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.appEngineRoutingOverride != null && message.hasOwnProperty("appEngineRoutingOverride")) { - var error = $root.google.cloud.tasks.v2beta3.AppEngineRouting.verify(message.appEngineRoutingOverride); - if (error) - return "appEngineRoutingOverride." + error; - } - return null; - }; - - /** - * Creates an AppEngineHttpQueue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpQueue} AppEngineHttpQueue - */ - AppEngineHttpQueue.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue) - return object; - var message = new $root.google.cloud.tasks.v2beta3.AppEngineHttpQueue(); - if (object.appEngineRoutingOverride != null) { - if (typeof object.appEngineRoutingOverride !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.AppEngineHttpQueue.appEngineRoutingOverride: object expected"); - message.appEngineRoutingOverride = $root.google.cloud.tasks.v2beta3.AppEngineRouting.fromObject(object.appEngineRoutingOverride); - } - return message; - }; - - /** - * Creates a plain object from an AppEngineHttpQueue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {google.cloud.tasks.v2beta3.AppEngineHttpQueue} message AppEngineHttpQueue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineHttpQueue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.appEngineRoutingOverride = null; - if (message.appEngineRoutingOverride != null && message.hasOwnProperty("appEngineRoutingOverride")) - object.appEngineRoutingOverride = $root.google.cloud.tasks.v2beta3.AppEngineRouting.toObject(message.appEngineRoutingOverride, options); - return object; - }; - - /** - * Converts this AppEngineHttpQueue to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @instance - * @returns {Object.} JSON object - */ - AppEngineHttpQueue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineHttpQueue - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpQueue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineHttpQueue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.AppEngineHttpQueue"; - }; - - return AppEngineHttpQueue; - })(); - - v2beta3.AppEngineHttpRequest = (function() { - - /** - * Properties of an AppEngineHttpRequest. - * @memberof google.cloud.tasks.v2beta3 - * @interface IAppEngineHttpRequest - * @property {google.cloud.tasks.v2beta3.HttpMethod|null} [httpMethod] AppEngineHttpRequest httpMethod - * @property {google.cloud.tasks.v2beta3.IAppEngineRouting|null} [appEngineRouting] AppEngineHttpRequest appEngineRouting - * @property {string|null} [relativeUri] AppEngineHttpRequest relativeUri - * @property {Object.|null} [headers] AppEngineHttpRequest headers - * @property {Uint8Array|null} [body] AppEngineHttpRequest body - */ - - /** - * Constructs a new AppEngineHttpRequest. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents an AppEngineHttpRequest. - * @implements IAppEngineHttpRequest - * @constructor - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpRequest=} [properties] Properties to set - */ - function AppEngineHttpRequest(properties) { - this.headers = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineHttpRequest httpMethod. - * @member {google.cloud.tasks.v2beta3.HttpMethod} httpMethod - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.httpMethod = 0; - - /** - * AppEngineHttpRequest appEngineRouting. - * @member {google.cloud.tasks.v2beta3.IAppEngineRouting|null|undefined} appEngineRouting - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.appEngineRouting = null; - - /** - * AppEngineHttpRequest relativeUri. - * @member {string} relativeUri - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.relativeUri = ""; - - /** - * AppEngineHttpRequest headers. - * @member {Object.} headers - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.headers = $util.emptyObject; - - /** - * AppEngineHttpRequest body. - * @member {Uint8Array} body - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @instance - */ - AppEngineHttpRequest.prototype.body = $util.newBuffer([]); - - /** - * Creates a new AppEngineHttpRequest instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpRequest=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpRequest} AppEngineHttpRequest instance - */ - AppEngineHttpRequest.create = function create(properties) { - return new AppEngineHttpRequest(properties); - }; - - /** - * Encodes the specified AppEngineHttpRequest message. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpRequest} message AppEngineHttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.httpMethod != null && Object.hasOwnProperty.call(message, "httpMethod")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.httpMethod); - if (message.appEngineRouting != null && Object.hasOwnProperty.call(message, "appEngineRouting")) - $root.google.cloud.tasks.v2beta3.AppEngineRouting.encode(message.appEngineRouting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.relativeUri != null && Object.hasOwnProperty.call(message, "relativeUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.relativeUri); - if (message.headers != null && Object.hasOwnProperty.call(message, "headers")) - for (var keys = Object.keys(message.headers), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.headers[keys[i]]).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.body); - return writer; - }; - - /** - * Encodes the specified AppEngineHttpRequest message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineHttpRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineHttpRequest} message AppEngineHttpRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineHttpRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpRequest} AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.httpMethod = reader.int32(); - break; - } - case 2: { - message.appEngineRouting = $root.google.cloud.tasks.v2beta3.AppEngineRouting.decode(reader, reader.uint32()); - break; - } - case 3: { - message.relativeUri = reader.string(); - break; - } - case 4: { - if (message.headers === $util.emptyObject) - message.headers = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.headers[key] = value; - break; - } - case 5: { - message.body = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineHttpRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpRequest} AppEngineHttpRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineHttpRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineHttpRequest message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineHttpRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - switch (message.httpMethod) { - default: - return "httpMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.appEngineRouting != null && message.hasOwnProperty("appEngineRouting")) { - var error = $root.google.cloud.tasks.v2beta3.AppEngineRouting.verify(message.appEngineRouting); - if (error) - return "appEngineRouting." + error; - } - if (message.relativeUri != null && message.hasOwnProperty("relativeUri")) - if (!$util.isString(message.relativeUri)) - return "relativeUri: string expected"; - if (message.headers != null && message.hasOwnProperty("headers")) { - if (!$util.isObject(message.headers)) - return "headers: object expected"; - var key = Object.keys(message.headers); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.headers[key[i]])) - return "headers: string{k:string} expected"; - } - if (message.body != null && message.hasOwnProperty("body")) - if (!(message.body && typeof message.body.length === "number" || $util.isString(message.body))) - return "body: buffer expected"; - return null; - }; - - /** - * Creates an AppEngineHttpRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.AppEngineHttpRequest} AppEngineHttpRequest - */ - AppEngineHttpRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest) - return object; - var message = new $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest(); - switch (object.httpMethod) { - default: - if (typeof object.httpMethod === "number") { - message.httpMethod = object.httpMethod; - break; - } - break; - case "HTTP_METHOD_UNSPECIFIED": - case 0: - message.httpMethod = 0; - break; - case "POST": - case 1: - message.httpMethod = 1; - break; - case "GET": - case 2: - message.httpMethod = 2; - break; - case "HEAD": - case 3: - message.httpMethod = 3; - break; - case "PUT": - case 4: - message.httpMethod = 4; - break; - case "DELETE": - case 5: - message.httpMethod = 5; - break; - case "PATCH": - case 6: - message.httpMethod = 6; - break; - case "OPTIONS": - case 7: - message.httpMethod = 7; - break; - } - if (object.appEngineRouting != null) { - if (typeof object.appEngineRouting !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.AppEngineHttpRequest.appEngineRouting: object expected"); - message.appEngineRouting = $root.google.cloud.tasks.v2beta3.AppEngineRouting.fromObject(object.appEngineRouting); - } - if (object.relativeUri != null) - message.relativeUri = String(object.relativeUri); - if (object.headers) { - if (typeof object.headers !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.AppEngineHttpRequest.headers: object expected"); - message.headers = {}; - for (var keys = Object.keys(object.headers), i = 0; i < keys.length; ++i) - message.headers[keys[i]] = String(object.headers[keys[i]]); - } - if (object.body != null) - if (typeof object.body === "string") - $util.base64.decode(object.body, message.body = $util.newBuffer($util.base64.length(object.body)), 0); - else if (object.body.length >= 0) - message.body = object.body; - return message; - }; - - /** - * Creates a plain object from an AppEngineHttpRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {google.cloud.tasks.v2beta3.AppEngineHttpRequest} message AppEngineHttpRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineHttpRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.headers = {}; - if (options.defaults) { - object.httpMethod = options.enums === String ? "HTTP_METHOD_UNSPECIFIED" : 0; - object.appEngineRouting = null; - object.relativeUri = ""; - if (options.bytes === String) - object.body = ""; - else { - object.body = []; - if (options.bytes !== Array) - object.body = $util.newBuffer(object.body); - } - } - if (message.httpMethod != null && message.hasOwnProperty("httpMethod")) - object.httpMethod = options.enums === String ? $root.google.cloud.tasks.v2beta3.HttpMethod[message.httpMethod] === undefined ? message.httpMethod : $root.google.cloud.tasks.v2beta3.HttpMethod[message.httpMethod] : message.httpMethod; - if (message.appEngineRouting != null && message.hasOwnProperty("appEngineRouting")) - object.appEngineRouting = $root.google.cloud.tasks.v2beta3.AppEngineRouting.toObject(message.appEngineRouting, options); - if (message.relativeUri != null && message.hasOwnProperty("relativeUri")) - object.relativeUri = message.relativeUri; - var keys2; - if (message.headers && (keys2 = Object.keys(message.headers)).length) { - object.headers = {}; - for (var j = 0; j < keys2.length; ++j) - object.headers[keys2[j]] = message.headers[keys2[j]]; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = options.bytes === String ? $util.base64.encode(message.body, 0, message.body.length) : options.bytes === Array ? Array.prototype.slice.call(message.body) : message.body; - return object; - }; - - /** - * Converts this AppEngineHttpRequest to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @instance - * @returns {Object.} JSON object - */ - AppEngineHttpRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineHttpRequest - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.AppEngineHttpRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineHttpRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.AppEngineHttpRequest"; - }; - - return AppEngineHttpRequest; - })(); - - v2beta3.AppEngineRouting = (function() { - - /** - * Properties of an AppEngineRouting. - * @memberof google.cloud.tasks.v2beta3 - * @interface IAppEngineRouting - * @property {string|null} [service] AppEngineRouting service - * @property {string|null} [version] AppEngineRouting version - * @property {string|null} [instance] AppEngineRouting instance - * @property {string|null} [host] AppEngineRouting host - */ - - /** - * Constructs a new AppEngineRouting. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents an AppEngineRouting. - * @implements IAppEngineRouting - * @constructor - * @param {google.cloud.tasks.v2beta3.IAppEngineRouting=} [properties] Properties to set - */ - function AppEngineRouting(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AppEngineRouting service. - * @member {string} service - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.service = ""; - - /** - * AppEngineRouting version. - * @member {string} version - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.version = ""; - - /** - * AppEngineRouting instance. - * @member {string} instance - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.instance = ""; - - /** - * AppEngineRouting host. - * @member {string} host - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @instance - */ - AppEngineRouting.prototype.host = ""; - - /** - * Creates a new AppEngineRouting instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineRouting=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.AppEngineRouting} AppEngineRouting instance - */ - AppEngineRouting.create = function create(properties) { - return new AppEngineRouting(properties); - }; - - /** - * Encodes the specified AppEngineRouting message. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineRouting.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineRouting} message AppEngineRouting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineRouting.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instance); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - return writer; - }; - - /** - * Encodes the specified AppEngineRouting message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.AppEngineRouting.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta3.IAppEngineRouting} message AppEngineRouting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AppEngineRouting.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.AppEngineRouting} AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineRouting.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.AppEngineRouting(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 2: { - message.version = reader.string(); - break; - } - case 3: { - message.instance = reader.string(); - break; - } - case 4: { - message.host = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AppEngineRouting message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.AppEngineRouting} AppEngineRouting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AppEngineRouting.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AppEngineRouting message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AppEngineRouting.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) - if (!$util.isString(message.instance)) - return "instance: string expected"; - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - return null; - }; - - /** - * Creates an AppEngineRouting message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.AppEngineRouting} AppEngineRouting - */ - AppEngineRouting.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.AppEngineRouting) - return object; - var message = new $root.google.cloud.tasks.v2beta3.AppEngineRouting(); - if (object.service != null) - message.service = String(object.service); - if (object.version != null) - message.version = String(object.version); - if (object.instance != null) - message.instance = String(object.instance); - if (object.host != null) - message.host = String(object.host); - return message; - }; - - /** - * Creates a plain object from an AppEngineRouting message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {google.cloud.tasks.v2beta3.AppEngineRouting} message AppEngineRouting - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AppEngineRouting.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.service = ""; - object.version = ""; - object.instance = ""; - object.host = ""; - } - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = message.instance; - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - return object; - }; - - /** - * Converts this AppEngineRouting to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @instance - * @returns {Object.} JSON object - */ - AppEngineRouting.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AppEngineRouting - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.AppEngineRouting - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AppEngineRouting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.AppEngineRouting"; - }; - - return AppEngineRouting; - })(); - - /** - * HttpMethod enum. - * @name google.cloud.tasks.v2beta3.HttpMethod - * @enum {number} - * @property {number} HTTP_METHOD_UNSPECIFIED=0 HTTP_METHOD_UNSPECIFIED value - * @property {number} POST=1 POST value - * @property {number} GET=2 GET value - * @property {number} HEAD=3 HEAD value - * @property {number} PUT=4 PUT value - * @property {number} DELETE=5 DELETE value - * @property {number} PATCH=6 PATCH value - * @property {number} OPTIONS=7 OPTIONS value - */ - v2beta3.HttpMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HTTP_METHOD_UNSPECIFIED"] = 0; - values[valuesById[1] = "POST"] = 1; - values[valuesById[2] = "GET"] = 2; - values[valuesById[3] = "HEAD"] = 3; - values[valuesById[4] = "PUT"] = 4; - values[valuesById[5] = "DELETE"] = 5; - values[valuesById[6] = "PATCH"] = 6; - values[valuesById[7] = "OPTIONS"] = 7; - return values; - })(); - - v2beta3.OAuthToken = (function() { - - /** - * Properties of a OAuthToken. - * @memberof google.cloud.tasks.v2beta3 - * @interface IOAuthToken - * @property {string|null} [serviceAccountEmail] OAuthToken serviceAccountEmail - * @property {string|null} [scope] OAuthToken scope - */ - - /** - * Constructs a new OAuthToken. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a OAuthToken. - * @implements IOAuthToken - * @constructor - * @param {google.cloud.tasks.v2beta3.IOAuthToken=} [properties] Properties to set - */ - function OAuthToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OAuthToken serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @instance - */ - OAuthToken.prototype.serviceAccountEmail = ""; - - /** - * OAuthToken scope. - * @member {string} scope - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @instance - */ - OAuthToken.prototype.scope = ""; - - /** - * Creates a new OAuthToken instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {google.cloud.tasks.v2beta3.IOAuthToken=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.OAuthToken} OAuthToken instance - */ - OAuthToken.create = function create(properties) { - return new OAuthToken(properties); - }; - - /** - * Encodes the specified OAuthToken message. Does not implicitly {@link google.cloud.tasks.v2beta3.OAuthToken.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {google.cloud.tasks.v2beta3.IOAuthToken} message OAuthToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scope); - return writer; - }; - - /** - * Encodes the specified OAuthToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.OAuthToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {google.cloud.tasks.v2beta3.IOAuthToken} message OAuthToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OAuthToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a OAuthToken message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.OAuthToken} OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthToken.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.OAuthToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.serviceAccountEmail = reader.string(); - break; - } - case 2: { - message.scope = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a OAuthToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.OAuthToken} OAuthToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OAuthToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a OAuthToken message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OAuthToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.scope != null && message.hasOwnProperty("scope")) - if (!$util.isString(message.scope)) - return "scope: string expected"; - return null; - }; - - /** - * Creates a OAuthToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.OAuthToken} OAuthToken - */ - OAuthToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.OAuthToken) - return object; - var message = new $root.google.cloud.tasks.v2beta3.OAuthToken(); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.scope != null) - message.scope = String(object.scope); - return message; - }; - - /** - * Creates a plain object from a OAuthToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {google.cloud.tasks.v2beta3.OAuthToken} message OAuthToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OAuthToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceAccountEmail = ""; - object.scope = ""; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = message.scope; - return object; - }; - - /** - * Converts this OAuthToken to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @instance - * @returns {Object.} JSON object - */ - OAuthToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OAuthToken - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.OAuthToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OAuthToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.OAuthToken"; - }; - - return OAuthToken; - })(); - - v2beta3.OidcToken = (function() { - - /** - * Properties of an OidcToken. - * @memberof google.cloud.tasks.v2beta3 - * @interface IOidcToken - * @property {string|null} [serviceAccountEmail] OidcToken serviceAccountEmail - * @property {string|null} [audience] OidcToken audience - */ - - /** - * Constructs a new OidcToken. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents an OidcToken. - * @implements IOidcToken - * @constructor - * @param {google.cloud.tasks.v2beta3.IOidcToken=} [properties] Properties to set - */ - function OidcToken(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OidcToken serviceAccountEmail. - * @member {string} serviceAccountEmail - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @instance - */ - OidcToken.prototype.serviceAccountEmail = ""; - - /** - * OidcToken audience. - * @member {string} audience - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @instance - */ - OidcToken.prototype.audience = ""; - - /** - * Creates a new OidcToken instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {google.cloud.tasks.v2beta3.IOidcToken=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.OidcToken} OidcToken instance - */ - OidcToken.create = function create(properties) { - return new OidcToken(properties); - }; - - /** - * Encodes the specified OidcToken message. Does not implicitly {@link google.cloud.tasks.v2beta3.OidcToken.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {google.cloud.tasks.v2beta3.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceAccountEmail); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.audience); - return writer; - }; - - /** - * Encodes the specified OidcToken message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.OidcToken.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {google.cloud.tasks.v2beta3.IOidcToken} message OidcToken message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OidcToken.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.OidcToken(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.serviceAccountEmail = reader.string(); - break; - } - case 2: { - message.audience = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OidcToken message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.OidcToken} OidcToken - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OidcToken.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OidcToken message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OidcToken.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.audience != null && message.hasOwnProperty("audience")) - if (!$util.isString(message.audience)) - return "audience: string expected"; - return null; - }; - - /** - * Creates an OidcToken message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.OidcToken} OidcToken - */ - OidcToken.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.OidcToken) - return object; - var message = new $root.google.cloud.tasks.v2beta3.OidcToken(); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.audience != null) - message.audience = String(object.audience); - return message; - }; - - /** - * Creates a plain object from an OidcToken message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {google.cloud.tasks.v2beta3.OidcToken} message OidcToken - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OidcToken.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceAccountEmail = ""; - object.audience = ""; - } - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = message.audience; - return object; - }; - - /** - * Converts this OidcToken to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @instance - * @returns {Object.} JSON object - */ - OidcToken.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OidcToken - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.OidcToken - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OidcToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.OidcToken"; - }; - - return OidcToken; - })(); - - v2beta3.Task = (function() { - - /** - * Properties of a Task. - * @memberof google.cloud.tasks.v2beta3 - * @interface ITask - * @property {string|null} [name] Task name - * @property {google.cloud.tasks.v2beta3.IAppEngineHttpRequest|null} [appEngineHttpRequest] Task appEngineHttpRequest - * @property {google.cloud.tasks.v2beta3.IHttpRequest|null} [httpRequest] Task httpRequest - * @property {google.cloud.tasks.v2beta3.IPullMessage|null} [pullMessage] Task pullMessage - * @property {google.protobuf.ITimestamp|null} [scheduleTime] Task scheduleTime - * @property {google.protobuf.ITimestamp|null} [createTime] Task createTime - * @property {google.protobuf.IDuration|null} [dispatchDeadline] Task dispatchDeadline - * @property {number|null} [dispatchCount] Task dispatchCount - * @property {number|null} [responseCount] Task responseCount - * @property {google.cloud.tasks.v2beta3.IAttempt|null} [firstAttempt] Task firstAttempt - * @property {google.cloud.tasks.v2beta3.IAttempt|null} [lastAttempt] Task lastAttempt - * @property {google.cloud.tasks.v2beta3.Task.View|null} [view] Task view - */ - - /** - * Constructs a new Task. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents a Task. - * @implements ITask - * @constructor - * @param {google.cloud.tasks.v2beta3.ITask=} [properties] Properties to set - */ - function Task(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Task name. - * @member {string} name - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.name = ""; - - /** - * Task appEngineHttpRequest. - * @member {google.cloud.tasks.v2beta3.IAppEngineHttpRequest|null|undefined} appEngineHttpRequest - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.appEngineHttpRequest = null; - - /** - * Task httpRequest. - * @member {google.cloud.tasks.v2beta3.IHttpRequest|null|undefined} httpRequest - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.httpRequest = null; - - /** - * Task pullMessage. - * @member {google.cloud.tasks.v2beta3.IPullMessage|null|undefined} pullMessage - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.pullMessage = null; - - /** - * Task scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.scheduleTime = null; - - /** - * Task createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.createTime = null; - - /** - * Task dispatchDeadline. - * @member {google.protobuf.IDuration|null|undefined} dispatchDeadline - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.dispatchDeadline = null; - - /** - * Task dispatchCount. - * @member {number} dispatchCount - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.dispatchCount = 0; - - /** - * Task responseCount. - * @member {number} responseCount - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.responseCount = 0; - - /** - * Task firstAttempt. - * @member {google.cloud.tasks.v2beta3.IAttempt|null|undefined} firstAttempt - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.firstAttempt = null; - - /** - * Task lastAttempt. - * @member {google.cloud.tasks.v2beta3.IAttempt|null|undefined} lastAttempt - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.lastAttempt = null; - - /** - * Task view. - * @member {google.cloud.tasks.v2beta3.Task.View} view - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Task.prototype.view = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Task payloadType. - * @member {"appEngineHttpRequest"|"httpRequest"|"pullMessage"|undefined} payloadType - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - */ - Object.defineProperty(Task.prototype, "payloadType", { - get: $util.oneOfGetter($oneOfFields = ["appEngineHttpRequest", "httpRequest", "pullMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Task instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {google.cloud.tasks.v2beta3.ITask=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.Task} Task instance - */ - Task.create = function create(properties) { - return new Task(properties); - }; - - /** - * Encodes the specified Task message. Does not implicitly {@link google.cloud.tasks.v2beta3.Task.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {google.cloud.tasks.v2beta3.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.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.appEngineHttpRequest != null && Object.hasOwnProperty.call(message, "appEngineHttpRequest")) - $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest.encode(message.appEngineHttpRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.dispatchCount != null && Object.hasOwnProperty.call(message, "dispatchCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.dispatchCount); - if (message.responseCount != null && Object.hasOwnProperty.call(message, "responseCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.responseCount); - if (message.firstAttempt != null && Object.hasOwnProperty.call(message, "firstAttempt")) - $root.google.cloud.tasks.v2beta3.Attempt.encode(message.firstAttempt, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lastAttempt != null && Object.hasOwnProperty.call(message, "lastAttempt")) - $root.google.cloud.tasks.v2beta3.Attempt.encode(message.lastAttempt, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.view); - if (message.httpRequest != null && Object.hasOwnProperty.call(message, "httpRequest")) - $root.google.cloud.tasks.v2beta3.HttpRequest.encode(message.httpRequest, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.dispatchDeadline != null && Object.hasOwnProperty.call(message, "dispatchDeadline")) - $root.google.protobuf.Duration.encode(message.dispatchDeadline, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.pullMessage != null && Object.hasOwnProperty.call(message, "pullMessage")) - $root.google.cloud.tasks.v2beta3.PullMessage.encode(message.pullMessage, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Task message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.Task.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {google.cloud.tasks.v2beta3.ITask} message Task message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Task.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Task message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.Task(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.appEngineHttpRequest = $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest.decode(reader, reader.uint32()); - break; - } - case 11: { - message.httpRequest = $root.google.cloud.tasks.v2beta3.HttpRequest.decode(reader, reader.uint32()); - break; - } - case 13: { - message.pullMessage = $root.google.cloud.tasks.v2beta3.PullMessage.decode(reader, reader.uint32()); - break; - } - case 4: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.dispatchDeadline = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.dispatchCount = reader.int32(); - break; - } - case 7: { - message.responseCount = reader.int32(); - break; - } - case 8: { - message.firstAttempt = $root.google.cloud.tasks.v2beta3.Attempt.decode(reader, reader.uint32()); - break; - } - case 9: { - message.lastAttempt = $root.google.cloud.tasks.v2beta3.Attempt.decode(reader, reader.uint32()); - break; - } - case 10: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Task message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.Task} Task - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Task.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Task message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Task.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.appEngineHttpRequest != null && message.hasOwnProperty("appEngineHttpRequest")) { - properties.payloadType = 1; - { - var error = $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest.verify(message.appEngineHttpRequest); - if (error) - return "appEngineHttpRequest." + error; - } - } - if (message.httpRequest != null && message.hasOwnProperty("httpRequest")) { - if (properties.payloadType === 1) - return "payloadType: multiple values"; - properties.payloadType = 1; - { - var error = $root.google.cloud.tasks.v2beta3.HttpRequest.verify(message.httpRequest); - if (error) - return "httpRequest." + error; - } - } - if (message.pullMessage != null && message.hasOwnProperty("pullMessage")) { - if (properties.payloadType === 1) - return "payloadType: multiple values"; - properties.payloadType = 1; - { - var error = $root.google.cloud.tasks.v2beta3.PullMessage.verify(message.pullMessage); - if (error) - return "pullMessage." + error; - } - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.dispatchDeadline != null && message.hasOwnProperty("dispatchDeadline")) { - var error = $root.google.protobuf.Duration.verify(message.dispatchDeadline); - if (error) - return "dispatchDeadline." + error; - } - if (message.dispatchCount != null && message.hasOwnProperty("dispatchCount")) - if (!$util.isInteger(message.dispatchCount)) - return "dispatchCount: integer expected"; - if (message.responseCount != null && message.hasOwnProperty("responseCount")) - if (!$util.isInteger(message.responseCount)) - return "responseCount: integer expected"; - if (message.firstAttempt != null && message.hasOwnProperty("firstAttempt")) { - var error = $root.google.cloud.tasks.v2beta3.Attempt.verify(message.firstAttempt); - if (error) - return "firstAttempt." + error; - } - if (message.lastAttempt != null && message.hasOwnProperty("lastAttempt")) { - var error = $root.google.cloud.tasks.v2beta3.Attempt.verify(message.lastAttempt); - if (error) - return "lastAttempt." + error; - } - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a Task message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.Task} Task - */ - Task.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.Task) - return object; - var message = new $root.google.cloud.tasks.v2beta3.Task(); - if (object.name != null) - message.name = String(object.name); - if (object.appEngineHttpRequest != null) { - if (typeof object.appEngineHttpRequest !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.appEngineHttpRequest: object expected"); - message.appEngineHttpRequest = $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest.fromObject(object.appEngineHttpRequest); - } - if (object.httpRequest != null) { - if (typeof object.httpRequest !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.httpRequest: object expected"); - message.httpRequest = $root.google.cloud.tasks.v2beta3.HttpRequest.fromObject(object.httpRequest); - } - if (object.pullMessage != null) { - if (typeof object.pullMessage !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.pullMessage: object expected"); - message.pullMessage = $root.google.cloud.tasks.v2beta3.PullMessage.fromObject(object.pullMessage); - } - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.dispatchDeadline != null) { - if (typeof object.dispatchDeadline !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.dispatchDeadline: object expected"); - message.dispatchDeadline = $root.google.protobuf.Duration.fromObject(object.dispatchDeadline); - } - if (object.dispatchCount != null) - message.dispatchCount = object.dispatchCount | 0; - if (object.responseCount != null) - message.responseCount = object.responseCount | 0; - if (object.firstAttempt != null) { - if (typeof object.firstAttempt !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.firstAttempt: object expected"); - message.firstAttempt = $root.google.cloud.tasks.v2beta3.Attempt.fromObject(object.firstAttempt); - } - if (object.lastAttempt != null) { - if (typeof object.lastAttempt !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Task.lastAttempt: object expected"); - message.lastAttempt = $root.google.cloud.tasks.v2beta3.Attempt.fromObject(object.lastAttempt); - } - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BASIC": - case 1: - message.view = 1; - break; - case "FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a Task message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {google.cloud.tasks.v2beta3.Task} message Task - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Task.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.scheduleTime = null; - object.createTime = null; - object.dispatchCount = 0; - object.responseCount = 0; - object.firstAttempt = null; - object.lastAttempt = null; - object.view = options.enums === String ? "VIEW_UNSPECIFIED" : 0; - object.dispatchDeadline = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.appEngineHttpRequest != null && message.hasOwnProperty("appEngineHttpRequest")) { - object.appEngineHttpRequest = $root.google.cloud.tasks.v2beta3.AppEngineHttpRequest.toObject(message.appEngineHttpRequest, options); - if (options.oneofs) - object.payloadType = "appEngineHttpRequest"; - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.dispatchCount != null && message.hasOwnProperty("dispatchCount")) - object.dispatchCount = message.dispatchCount; - if (message.responseCount != null && message.hasOwnProperty("responseCount")) - object.responseCount = message.responseCount; - if (message.firstAttempt != null && message.hasOwnProperty("firstAttempt")) - object.firstAttempt = $root.google.cloud.tasks.v2beta3.Attempt.toObject(message.firstAttempt, options); - if (message.lastAttempt != null && message.hasOwnProperty("lastAttempt")) - object.lastAttempt = $root.google.cloud.tasks.v2beta3.Attempt.toObject(message.lastAttempt, options); - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.tasks.v2beta3.Task.View[message.view] === undefined ? message.view : $root.google.cloud.tasks.v2beta3.Task.View[message.view] : message.view; - if (message.httpRequest != null && message.hasOwnProperty("httpRequest")) { - object.httpRequest = $root.google.cloud.tasks.v2beta3.HttpRequest.toObject(message.httpRequest, options); - if (options.oneofs) - object.payloadType = "httpRequest"; - } - if (message.dispatchDeadline != null && message.hasOwnProperty("dispatchDeadline")) - object.dispatchDeadline = $root.google.protobuf.Duration.toObject(message.dispatchDeadline, options); - if (message.pullMessage != null && message.hasOwnProperty("pullMessage")) { - object.pullMessage = $root.google.cloud.tasks.v2beta3.PullMessage.toObject(message.pullMessage, options); - if (options.oneofs) - object.payloadType = "pullMessage"; - } - return object; - }; - - /** - * Converts this Task to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.Task - * @instance - * @returns {Object.} JSON object - */ - Task.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Task - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.Task - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Task.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.Task"; - }; - - /** - * View enum. - * @name google.cloud.tasks.v2beta3.Task.View - * @enum {number} - * @property {number} VIEW_UNSPECIFIED=0 VIEW_UNSPECIFIED value - * @property {number} BASIC=1 BASIC value - * @property {number} FULL=2 FULL value - */ - Task.View = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "BASIC"] = 1; - values[valuesById[2] = "FULL"] = 2; - return values; - })(); - - return Task; - })(); - - v2beta3.Attempt = (function() { - - /** - * Properties of an Attempt. - * @memberof google.cloud.tasks.v2beta3 - * @interface IAttempt - * @property {google.protobuf.ITimestamp|null} [scheduleTime] Attempt scheduleTime - * @property {google.protobuf.ITimestamp|null} [dispatchTime] Attempt dispatchTime - * @property {google.protobuf.ITimestamp|null} [responseTime] Attempt responseTime - * @property {google.rpc.IStatus|null} [responseStatus] Attempt responseStatus - */ - - /** - * Constructs a new Attempt. - * @memberof google.cloud.tasks.v2beta3 - * @classdesc Represents an Attempt. - * @implements IAttempt - * @constructor - * @param {google.cloud.tasks.v2beta3.IAttempt=} [properties] Properties to set - */ - function Attempt(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Attempt scheduleTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime - * @memberof google.cloud.tasks.v2beta3.Attempt - * @instance - */ - Attempt.prototype.scheduleTime = null; - - /** - * Attempt dispatchTime. - * @member {google.protobuf.ITimestamp|null|undefined} dispatchTime - * @memberof google.cloud.tasks.v2beta3.Attempt - * @instance - */ - Attempt.prototype.dispatchTime = null; - - /** - * Attempt responseTime. - * @member {google.protobuf.ITimestamp|null|undefined} responseTime - * @memberof google.cloud.tasks.v2beta3.Attempt - * @instance - */ - Attempt.prototype.responseTime = null; - - /** - * Attempt responseStatus. - * @member {google.rpc.IStatus|null|undefined} responseStatus - * @memberof google.cloud.tasks.v2beta3.Attempt - * @instance - */ - Attempt.prototype.responseStatus = null; - - /** - * Creates a new Attempt instance using the specified properties. - * @function create - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {google.cloud.tasks.v2beta3.IAttempt=} [properties] Properties to set - * @returns {google.cloud.tasks.v2beta3.Attempt} Attempt instance - */ - Attempt.create = function create(properties) { - return new Attempt(properties); - }; - - /** - * Encodes the specified Attempt message. Does not implicitly {@link google.cloud.tasks.v2beta3.Attempt.verify|verify} messages. - * @function encode - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {google.cloud.tasks.v2beta3.IAttempt} message Attempt message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attempt.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) - $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dispatchTime != null && Object.hasOwnProperty.call(message, "dispatchTime")) - $root.google.protobuf.Timestamp.encode(message.dispatchTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.responseTime != null && Object.hasOwnProperty.call(message, "responseTime")) - $root.google.protobuf.Timestamp.encode(message.responseTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.responseStatus != null && Object.hasOwnProperty.call(message, "responseStatus")) - $root.google.rpc.Status.encode(message.responseStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Attempt message, length delimited. Does not implicitly {@link google.cloud.tasks.v2beta3.Attempt.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {google.cloud.tasks.v2beta3.IAttempt} message Attempt message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attempt.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attempt message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.tasks.v2beta3.Attempt} Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attempt.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.tasks.v2beta3.Attempt(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.dispatchTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.responseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.responseStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attempt message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.tasks.v2beta3.Attempt} Attempt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attempt.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attempt message. - * @function verify - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attempt.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); - if (error) - return "scheduleTime." + error; - } - if (message.dispatchTime != null && message.hasOwnProperty("dispatchTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.dispatchTime); - if (error) - return "dispatchTime." + error; - } - if (message.responseTime != null && message.hasOwnProperty("responseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.responseTime); - if (error) - return "responseTime." + error; - } - if (message.responseStatus != null && message.hasOwnProperty("responseStatus")) { - var error = $root.google.rpc.Status.verify(message.responseStatus); - if (error) - return "responseStatus." + error; - } - return null; - }; - - /** - * Creates an Attempt message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.tasks.v2beta3.Attempt} Attempt - */ - Attempt.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.tasks.v2beta3.Attempt) - return object; - var message = new $root.google.cloud.tasks.v2beta3.Attempt(); - if (object.scheduleTime != null) { - if (typeof object.scheduleTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Attempt.scheduleTime: object expected"); - message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); - } - if (object.dispatchTime != null) { - if (typeof object.dispatchTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Attempt.dispatchTime: object expected"); - message.dispatchTime = $root.google.protobuf.Timestamp.fromObject(object.dispatchTime); - } - if (object.responseTime != null) { - if (typeof object.responseTime !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Attempt.responseTime: object expected"); - message.responseTime = $root.google.protobuf.Timestamp.fromObject(object.responseTime); - } - if (object.responseStatus != null) { - if (typeof object.responseStatus !== "object") - throw TypeError(".google.cloud.tasks.v2beta3.Attempt.responseStatus: object expected"); - message.responseStatus = $root.google.rpc.Status.fromObject(object.responseStatus); - } - return message; - }; - - /** - * Creates a plain object from an Attempt message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {google.cloud.tasks.v2beta3.Attempt} message Attempt - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attempt.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scheduleTime = null; - object.dispatchTime = null; - object.responseTime = null; - object.responseStatus = null; - } - if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) - object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); - if (message.dispatchTime != null && message.hasOwnProperty("dispatchTime")) - object.dispatchTime = $root.google.protobuf.Timestamp.toObject(message.dispatchTime, options); - if (message.responseTime != null && message.hasOwnProperty("responseTime")) - object.responseTime = $root.google.protobuf.Timestamp.toObject(message.responseTime, options); - if (message.responseStatus != null && message.hasOwnProperty("responseStatus")) - object.responseStatus = $root.google.rpc.Status.toObject(message.responseStatus, options); - return object; - }; - - /** - * Converts this Attempt to JSON. - * @function toJSON - * @memberof google.cloud.tasks.v2beta3.Attempt - * @instance - * @returns {Object.} JSON object - */ - Attempt.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Attempt - * @function getTypeUrl - * @memberof google.cloud.tasks.v2beta3.Attempt - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Attempt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.tasks.v2beta3.Attempt"; - }; - - return Attempt; - })(); - - return v2beta3; - })(); - - return tasks; - })(); - - return cloud; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Http message. - * @function verify - * @memberof google.api.Http - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Http.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) - return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - } - case 7: { - message.body = reader.string(); - break; - } - case 12: { - message.responseBody = reader.string(); - break; - } - case 11: { - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) - return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - return values; - })(); - - 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; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {string|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {string} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = ""; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 13: { - message.edition = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - if (!$util.isString(message.edition)) - return "edition: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - if (object.edition != null) - message.edition = String(object.edition); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 42: { - message.phpGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.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.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Empty - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty - */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) - return object; - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - return protobuf; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.iam = (function() { - - /** - * Namespace iam. - * @memberof google - * @namespace - */ - var iam = {}; - - iam.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.iam - * @namespace - */ - var v1 = {}; - - v1.IAMPolicy = (function() { - - /** - * Constructs a new IAMPolicy service. - * @memberof google.iam.v1 - * @classdesc Represents a IAMPolicy - * @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 IAMPolicy(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (IAMPolicy.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = IAMPolicy; - - /** - * Creates new IAMPolicy service using the specified rpc implementation. - * @function create - * @memberof google.iam.v1.IAMPolicy - * @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 {IAMPolicy} RPC service. Useful where requests and/or responses are streamed. - */ - IAMPolicy.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|setIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef SetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.setIamPolicy = function setIamPolicy(request, callback) { - return this.rpcCall(setIamPolicy, $root.google.iam.v1.SetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "SetIamPolicy" }); - - /** - * Calls SetIamPolicy. - * @function setIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ISetIamPolicyRequest} request SetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|getIamPolicy}. - * @memberof google.iam.v1.IAMPolicy - * @typedef GetIamPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.Policy} [response] Policy - */ - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @param {google.iam.v1.IAMPolicy.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.getIamPolicy = function getIamPolicy(request, callback) { - return this.rpcCall(getIamPolicy, $root.google.iam.v1.GetIamPolicyRequest, $root.google.iam.v1.Policy, request, callback); - }, "name", { value: "GetIamPolicy" }); - - /** - * Calls GetIamPolicy. - * @function getIamPolicy - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.IGetIamPolicyRequest} request GetIamPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.iam.v1.IAMPolicy|testIamPermissions}. - * @memberof google.iam.v1.IAMPolicy - * @typedef TestIamPermissionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.iam.v1.TestIamPermissionsResponse} [response] TestIamPermissionsResponse - */ - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @param {google.iam.v1.IAMPolicy.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestIamPermissionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(IAMPolicy.prototype.testIamPermissions = function testIamPermissions(request, callback) { - return this.rpcCall(testIamPermissions, $root.google.iam.v1.TestIamPermissionsRequest, $root.google.iam.v1.TestIamPermissionsResponse, request, callback); - }, "name", { value: "TestIamPermissions" }); - - /** - * Calls TestIamPermissions. - * @function testIamPermissions - * @memberof google.iam.v1.IAMPolicy - * @instance - * @param {google.iam.v1.ITestIamPermissionsRequest} request TestIamPermissionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return IAMPolicy; - })(); - - v1.SetIamPolicyRequest = (function() { - - /** - * Properties of a SetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface ISetIamPolicyRequest - * @property {string|null} [resource] SetIamPolicyRequest resource - * @property {google.iam.v1.IPolicy|null} [policy] SetIamPolicyRequest policy - * @property {google.protobuf.IFieldMask|null} [updateMask] SetIamPolicyRequest updateMask - */ - - /** - * Constructs a new SetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a SetIamPolicyRequest. - * @implements ISetIamPolicyRequest - * @constructor - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - */ - function SetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.resource = ""; - - /** - * SetIamPolicyRequest policy. - * @member {google.iam.v1.IPolicy|null|undefined} policy - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.policy = null; - - /** - * SetIamPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - */ - SetIamPolicyRequest.prototype.updateMask = null; - - /** - * Creates a new SetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest instance - */ - SetIamPolicyRequest.create = function create(properties) { - return new SetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified SetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.iam.v1.Policy.encode(message.policy, 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 SetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.SetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.ISetIamPolicyRequest} message SetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.SetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.policy = $root.google.iam.v1.Policy.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 SetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.iam.v1.Policy.verify(message.policy); - if (error) - return "policy." + 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 SetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.SetIamPolicyRequest} SetIamPolicyRequest - */ - SetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.SetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.SetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.policy: object expected"); - message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.iam.v1.SetIamPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from a SetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {google.iam.v1.SetIamPolicyRequest} message SetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.policy = null; - object.updateMask = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this SetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.SetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - SetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.SetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.SetIamPolicyRequest"; - }; - - return SetIamPolicyRequest; - })(); - - v1.GetIamPolicyRequest = (function() { - - /** - * Properties of a GetIamPolicyRequest. - * @memberof google.iam.v1 - * @interface IGetIamPolicyRequest - * @property {string|null} [resource] GetIamPolicyRequest resource - * @property {google.iam.v1.IGetPolicyOptions|null} [options] GetIamPolicyRequest options - */ - - /** - * Constructs a new GetIamPolicyRequest. - * @memberof google.iam.v1 - * @classdesc Represents a GetIamPolicyRequest. - * @implements IGetIamPolicyRequest - * @constructor - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - */ - function GetIamPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIamPolicyRequest resource. - * @member {string} resource - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.resource = ""; - - /** - * GetIamPolicyRequest options. - * @member {google.iam.v1.IGetPolicyOptions|null|undefined} options - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - */ - GetIamPolicyRequest.prototype.options = null; - - /** - * Creates a new GetIamPolicyRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest=} [properties] Properties to set - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest instance - */ - GetIamPolicyRequest.create = function create(properties) { - return new GetIamPolicyRequest(properties); - }; - - /** - * Encodes the specified GetIamPolicyRequest message. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.iam.v1.GetPolicyOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GetIamPolicyRequest message, length delimited. Does not implicitly {@link google.iam.v1.GetIamPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.IGetIamPolicyRequest} message GetIamPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetIamPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - message.options = $root.google.iam.v1.GetPolicyOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIamPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIamPolicyRequest message. - * @function verify - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIamPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.iam.v1.GetPolicyOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a GetIamPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetIamPolicyRequest} GetIamPolicyRequest - */ - GetIamPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetIamPolicyRequest) - return object; - var message = new $root.google.iam.v1.GetIamPolicyRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.iam.v1.GetIamPolicyRequest.options: object expected"); - message.options = $root.google.iam.v1.GetPolicyOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a GetIamPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {google.iam.v1.GetIamPolicyRequest} message GetIamPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIamPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.resource = ""; - object.options = null; - } - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.iam.v1.GetPolicyOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this GetIamPolicyRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.GetIamPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetIamPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetIamPolicyRequest - * @function getTypeUrl - * @memberof google.iam.v1.GetIamPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetIamPolicyRequest"; - }; - - return GetIamPolicyRequest; - })(); - - v1.TestIamPermissionsRequest = (function() { - - /** - * Properties of a TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsRequest - * @property {string|null} [resource] TestIamPermissionsRequest resource - * @property {Array.|null} [permissions] TestIamPermissionsRequest permissions - */ - - /** - * Constructs a new TestIamPermissionsRequest. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsRequest. - * @implements ITestIamPermissionsRequest - * @constructor - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - */ - function TestIamPermissionsRequest(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsRequest resource. - * @member {string} resource - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.resource = ""; - - /** - * TestIamPermissionsRequest permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - */ - TestIamPermissionsRequest.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsRequest instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest instance - */ - TestIamPermissionsRequest.create = function create(properties) { - return new TestIamPermissionsRequest(properties); - }; - - /** - * Encodes the specified TestIamPermissionsRequest message. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsRequest message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.ITestIamPermissionsRequest} message TestIamPermissionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.resource = reader.string(); - break; - } - case 2: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsRequest message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsRequest} TestIamPermissionsRequest - */ - TestIamPermissionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsRequest) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsRequest(); - if (object.resource != null) - message.resource = String(object.resource); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsRequest.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {google.iam.v1.TestIamPermissionsRequest} message TestIamPermissionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (options.defaults) - object.resource = ""; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsRequest to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsRequest - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsRequest - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsRequest"; - }; - - return TestIamPermissionsRequest; - })(); - - v1.TestIamPermissionsResponse = (function() { - - /** - * Properties of a TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @interface ITestIamPermissionsResponse - * @property {Array.|null} [permissions] TestIamPermissionsResponse permissions - */ - - /** - * Constructs a new TestIamPermissionsResponse. - * @memberof google.iam.v1 - * @classdesc Represents a TestIamPermissionsResponse. - * @implements ITestIamPermissionsResponse - * @constructor - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - */ - function TestIamPermissionsResponse(properties) { - this.permissions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TestIamPermissionsResponse permissions. - * @member {Array.} permissions - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - */ - TestIamPermissionsResponse.prototype.permissions = $util.emptyArray; - - /** - * Creates a new TestIamPermissionsResponse instance using the specified properties. - * @function create - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse=} [properties] Properties to set - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse instance - */ - TestIamPermissionsResponse.create = function create(properties) { - return new TestIamPermissionsResponse(properties); - }; - - /** - * Encodes the specified TestIamPermissionsResponse message. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.permissions != null && message.permissions.length) - for (var i = 0; i < message.permissions.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); - return writer; - }; - - /** - * Encodes the specified TestIamPermissionsResponse message, length delimited. Does not implicitly {@link google.iam.v1.TestIamPermissionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.ITestIamPermissionsResponse} message TestIamPermissionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TestIamPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.TestIamPermissionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.permissions && message.permissions.length)) - message.permissions = []; - message.permissions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TestIamPermissionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TestIamPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TestIamPermissionsResponse message. - * @function verify - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TestIamPermissionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.permissions != null && message.hasOwnProperty("permissions")) { - if (!Array.isArray(message.permissions)) - return "permissions: array expected"; - for (var i = 0; i < message.permissions.length; ++i) - if (!$util.isString(message.permissions[i])) - return "permissions: string[] expected"; - } - return null; - }; - - /** - * Creates a TestIamPermissionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.TestIamPermissionsResponse} TestIamPermissionsResponse - */ - TestIamPermissionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.TestIamPermissionsResponse) - return object; - var message = new $root.google.iam.v1.TestIamPermissionsResponse(); - if (object.permissions) { - if (!Array.isArray(object.permissions)) - throw TypeError(".google.iam.v1.TestIamPermissionsResponse.permissions: array expected"); - message.permissions = []; - for (var i = 0; i < object.permissions.length; ++i) - message.permissions[i] = String(object.permissions[i]); - } - return message; - }; - - /** - * Creates a plain object from a TestIamPermissionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {google.iam.v1.TestIamPermissionsResponse} message TestIamPermissionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TestIamPermissionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.permissions = []; - if (message.permissions && message.permissions.length) { - object.permissions = []; - for (var j = 0; j < message.permissions.length; ++j) - object.permissions[j] = message.permissions[j]; - } - return object; - }; - - /** - * Converts this TestIamPermissionsResponse to JSON. - * @function toJSON - * @memberof google.iam.v1.TestIamPermissionsResponse - * @instance - * @returns {Object.} JSON object - */ - TestIamPermissionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TestIamPermissionsResponse - * @function getTypeUrl - * @memberof google.iam.v1.TestIamPermissionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TestIamPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.TestIamPermissionsResponse"; - }; - - return TestIamPermissionsResponse; - })(); - - v1.GetPolicyOptions = (function() { - - /** - * Properties of a GetPolicyOptions. - * @memberof google.iam.v1 - * @interface IGetPolicyOptions - * @property {number|null} [requestedPolicyVersion] GetPolicyOptions requestedPolicyVersion - */ - - /** - * Constructs a new GetPolicyOptions. - * @memberof google.iam.v1 - * @classdesc Represents a GetPolicyOptions. - * @implements IGetPolicyOptions - * @constructor - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - */ - function GetPolicyOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetPolicyOptions requestedPolicyVersion. - * @member {number} requestedPolicyVersion - * @memberof google.iam.v1.GetPolicyOptions - * @instance - */ - GetPolicyOptions.prototype.requestedPolicyVersion = 0; - - /** - * Creates a new GetPolicyOptions instance using the specified properties. - * @function create - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions=} [properties] Properties to set - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions instance - */ - GetPolicyOptions.create = function create(properties) { - return new GetPolicyOptions(properties); - }; - - /** - * Encodes the specified GetPolicyOptions message. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requestedPolicyVersion != null && Object.hasOwnProperty.call(message, "requestedPolicyVersion")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.requestedPolicyVersion); - return writer; - }; - - /** - * Encodes the specified GetPolicyOptions message, length delimited. Does not implicitly {@link google.iam.v1.GetPolicyOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.IGetPolicyOptions} message GetPolicyOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetPolicyOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.GetPolicyOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.requestedPolicyVersion = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetPolicyOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetPolicyOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetPolicyOptions message. - * @function verify - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetPolicyOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - if (!$util.isInteger(message.requestedPolicyVersion)) - return "requestedPolicyVersion: integer expected"; - return null; - }; - - /** - * Creates a GetPolicyOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.GetPolicyOptions} GetPolicyOptions - */ - GetPolicyOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.GetPolicyOptions) - return object; - var message = new $root.google.iam.v1.GetPolicyOptions(); - if (object.requestedPolicyVersion != null) - message.requestedPolicyVersion = object.requestedPolicyVersion | 0; - return message; - }; - - /** - * Creates a plain object from a GetPolicyOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {google.iam.v1.GetPolicyOptions} message GetPolicyOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetPolicyOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.requestedPolicyVersion = 0; - if (message.requestedPolicyVersion != null && message.hasOwnProperty("requestedPolicyVersion")) - object.requestedPolicyVersion = message.requestedPolicyVersion; - return object; - }; - - /** - * Converts this GetPolicyOptions to JSON. - * @function toJSON - * @memberof google.iam.v1.GetPolicyOptions - * @instance - * @returns {Object.} JSON object - */ - GetPolicyOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetPolicyOptions - * @function getTypeUrl - * @memberof google.iam.v1.GetPolicyOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetPolicyOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.GetPolicyOptions"; - }; - - return GetPolicyOptions; - })(); - - v1.Policy = (function() { - - /** - * Properties of a Policy. - * @memberof google.iam.v1 - * @interface IPolicy - * @property {number|null} [version] Policy version - * @property {Array.|null} [bindings] Policy bindings - * @property {Array.|null} [auditConfigs] Policy auditConfigs - * @property {Uint8Array|null} [etag] Policy etag - */ - - /** - * Constructs a new Policy. - * @memberof google.iam.v1 - * @classdesc Represents a Policy. - * @implements IPolicy - * @constructor - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - */ - function Policy(properties) { - this.bindings = []; - this.auditConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Policy version. - * @member {number} version - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.version = 0; - - /** - * Policy bindings. - * @member {Array.} bindings - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.bindings = $util.emptyArray; - - /** - * Policy auditConfigs. - * @member {Array.} auditConfigs - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.auditConfigs = $util.emptyArray; - - /** - * Policy etag. - * @member {Uint8Array} etag - * @memberof google.iam.v1.Policy - * @instance - */ - Policy.prototype.etag = $util.newBuffer([]); - - /** - * Creates a new Policy instance using the specified properties. - * @function create - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy=} [properties] Properties to set - * @returns {google.iam.v1.Policy} Policy instance - */ - Policy.create = function create(properties) { - return new Policy(properties); - }; - - /** - * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); - if (message.bindings != null && message.bindings.length) - for (var i = 0; i < message.bindings.length; ++i) - $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.auditConfigs != null && message.auditConfigs.length) - for (var i = 0; i < message.auditConfigs.length; ++i) - $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Policy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Policy message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.version = reader.int32(); - break; - } - case 4: { - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.auditConfigs && message.auditConfigs.length)) - message.auditConfigs = []; - message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); - break; - } - case 3: { - message.etag = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Policy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Policy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Policy} Policy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Policy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Policy message. - * @function verify - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Policy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.bindings != null && message.hasOwnProperty("bindings")) { - if (!Array.isArray(message.bindings)) - return "bindings: array expected"; - for (var i = 0; i < message.bindings.length; ++i) { - var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); - if (error) - return "bindings." + error; - } - } - if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { - if (!Array.isArray(message.auditConfigs)) - return "auditConfigs: array expected"; - for (var i = 0; i < message.auditConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); - if (error) - return "auditConfigs." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) - return "etag: buffer expected"; - return null; - }; - - /** - * Creates a Policy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Policy - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Policy} Policy - */ - Policy.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Policy) - return object; - var message = new $root.google.iam.v1.Policy(); - if (object.version != null) - message.version = object.version | 0; - if (object.bindings) { - if (!Array.isArray(object.bindings)) - throw TypeError(".google.iam.v1.Policy.bindings: array expected"); - message.bindings = []; - for (var i = 0; i < object.bindings.length; ++i) { - if (typeof object.bindings[i] !== "object") - throw TypeError(".google.iam.v1.Policy.bindings: object expected"); - message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); - } - } - if (object.auditConfigs) { - if (!Array.isArray(object.auditConfigs)) - throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); - message.auditConfigs = []; - for (var i = 0; i < object.auditConfigs.length; ++i) { - if (typeof object.auditConfigs[i] !== "object") - throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); - message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); - } - } - if (object.etag != null) - if (typeof object.etag === "string") - $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length >= 0) - message.etag = object.etag; - return message; - }; - - /** - * Creates a plain object from a Policy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Policy - * @static - * @param {google.iam.v1.Policy} message Policy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Policy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindings = []; - object.auditConfigs = []; - } - if (options.defaults) { - object.version = 0; - if (options.bytes === String) - object.etag = ""; - else { - object.etag = []; - if (options.bytes !== Array) - object.etag = $util.newBuffer(object.etag); - } - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; - if (message.bindings && message.bindings.length) { - object.bindings = []; - for (var j = 0; j < message.bindings.length; ++j) - object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); - } - if (message.auditConfigs && message.auditConfigs.length) { - object.auditConfigs = []; - for (var j = 0; j < message.auditConfigs.length; ++j) - object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); - } - return object; - }; - - /** - * Converts this Policy to JSON. - * @function toJSON - * @memberof google.iam.v1.Policy - * @instance - * @returns {Object.} JSON object - */ - Policy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Policy - * @function getTypeUrl - * @memberof google.iam.v1.Policy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Policy"; - }; - - return Policy; - })(); - - v1.Binding = (function() { - - /** - * Properties of a Binding. - * @memberof google.iam.v1 - * @interface IBinding - * @property {string|null} [role] Binding role - * @property {Array.|null} [members] Binding members - * @property {google.type.IExpr|null} [condition] Binding condition - */ - - /** - * Constructs a new Binding. - * @memberof google.iam.v1 - * @classdesc Represents a Binding. - * @implements IBinding - * @constructor - * @param {google.iam.v1.IBinding=} [properties] Properties to set - */ - function Binding(properties) { - this.members = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Binding role. - * @member {string} role - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.role = ""; - - /** - * Binding members. - * @member {Array.} members - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.members = $util.emptyArray; - - /** - * Binding condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.Binding - * @instance - */ - Binding.prototype.condition = null; - - /** - * Creates a new Binding instance using the specified properties. - * @function create - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding=} [properties] Properties to set - * @returns {google.iam.v1.Binding} Binding instance - */ - Binding.create = function create(properties) { - return new Binding(properties); - }; - - /** - * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); - if (message.members != null && message.members.length) - for (var i = 0; i < message.members.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.IBinding} message Binding message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Binding.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Binding message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.role = reader.string(); - break; - } - case 2: { - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - } - case 3: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Binding message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.Binding - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.Binding} Binding - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Binding.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Binding message. - * @function verify - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Binding.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.members != null && message.hasOwnProperty("members")) { - if (!Array.isArray(message.members)) - return "members: array expected"; - for (var i = 0; i < message.members.length; ++i) - if (!$util.isString(message.members[i])) - return "members: string[] expected"; - } - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a Binding message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.Binding - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.Binding} Binding - */ - Binding.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.Binding) - return object; - var message = new $root.google.iam.v1.Binding(); - if (object.role != null) - message.role = String(object.role); - if (object.members) { - if (!Array.isArray(object.members)) - throw TypeError(".google.iam.v1.Binding.members: array expected"); - message.members = []; - for (var i = 0; i < object.members.length; ++i) - message.members[i] = String(object.members[i]); - } - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.Binding.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a Binding message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.Binding - * @static - * @param {google.iam.v1.Binding} message Binding - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Binding.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.members = []; - if (options.defaults) { - object.role = ""; - object.condition = null; - } - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.members && message.members.length) { - object.members = []; - for (var j = 0; j < message.members.length; ++j) - object.members[j] = message.members[j]; - } - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this Binding to JSON. - * @function toJSON - * @memberof google.iam.v1.Binding - * @instance - * @returns {Object.} JSON object - */ - Binding.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Binding - * @function getTypeUrl - * @memberof google.iam.v1.Binding - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.Binding"; - }; - - return Binding; - })(); - - v1.AuditConfig = (function() { - - /** - * Properties of an AuditConfig. - * @memberof google.iam.v1 - * @interface IAuditConfig - * @property {string|null} [service] AuditConfig service - * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs - */ - - /** - * Constructs a new AuditConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfig. - * @implements IAuditConfig - * @constructor - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - */ - function AuditConfig(properties) { - this.auditLogConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfig service. - * @member {string} service - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.service = ""; - - /** - * AuditConfig auditLogConfigs. - * @member {Array.} auditLogConfigs - * @memberof google.iam.v1.AuditConfig - * @instance - */ - AuditConfig.prototype.auditLogConfigs = $util.emptyArray; - - /** - * Creates a new AuditConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfig} AuditConfig instance - */ - AuditConfig.create = function create(properties) { - return new AuditConfig(properties); - }; - - /** - * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); - if (message.auditLogConfigs != null && message.auditLogConfigs.length) - for (var i = 0; i < message.auditLogConfigs.length; ++i) - $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.service = reader.string(); - break; - } - case 3: { - if (!(message.auditLogConfigs && message.auditLogConfigs.length)) - message.auditLogConfigs = []; - message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfig} AuditConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfig message. - * @function verify - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { - if (!Array.isArray(message.auditLogConfigs)) - return "auditLogConfigs: array expected"; - for (var i = 0; i < message.auditLogConfigs.length; ++i) { - var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); - if (error) - return "auditLogConfigs." + error; - } - } - return null; - }; - - /** - * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfig} AuditConfig - */ - AuditConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfig) - return object; - var message = new $root.google.iam.v1.AuditConfig(); - if (object.service != null) - message.service = String(object.service); - if (object.auditLogConfigs) { - if (!Array.isArray(object.auditLogConfigs)) - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); - message.auditLogConfigs = []; - for (var i = 0; i < object.auditLogConfigs.length; ++i) { - if (typeof object.auditLogConfigs[i] !== "object") - throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); - message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfig - * @static - * @param {google.iam.v1.AuditConfig} message AuditConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.auditLogConfigs = []; - if (options.defaults) - object.service = ""; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.auditLogConfigs && message.auditLogConfigs.length) { - object.auditLogConfigs = []; - for (var j = 0; j < message.auditLogConfigs.length; ++j) - object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); - } - return object; - }; - - /** - * Converts this AuditConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfig - * @instance - * @returns {Object.} JSON object - */ - AuditConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfig"; - }; - - return AuditConfig; - })(); - - v1.AuditLogConfig = (function() { - - /** - * Properties of an AuditLogConfig. - * @memberof google.iam.v1 - * @interface IAuditLogConfig - * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType - * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers - */ - - /** - * Constructs a new AuditLogConfig. - * @memberof google.iam.v1 - * @classdesc Represents an AuditLogConfig. - * @implements IAuditLogConfig - * @constructor - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - */ - function AuditLogConfig(properties) { - this.exemptedMembers = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditLogConfig logType. - * @member {google.iam.v1.AuditLogConfig.LogType} logType - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.logType = 0; - - /** - * AuditLogConfig exemptedMembers. - * @member {Array.} exemptedMembers - * @memberof google.iam.v1.AuditLogConfig - * @instance - */ - AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; - - /** - * Creates a new AuditLogConfig instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance - */ - AuditLogConfig.create = function create(properties) { - return new AuditLogConfig(properties); - }; - - /** - * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); - if (message.exemptedMembers != null && message.exemptedMembers.length) - for (var i = 0; i < message.exemptedMembers.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); - return writer; - }; - - /** - * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.logType = reader.int32(); - break; - } - case 2: { - if (!(message.exemptedMembers && message.exemptedMembers.length)) - message.exemptedMembers = []; - message.exemptedMembers.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditLogConfig message. - * @function verify - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditLogConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - switch (message.logType) { - default: - return "logType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { - if (!Array.isArray(message.exemptedMembers)) - return "exemptedMembers: array expected"; - for (var i = 0; i < message.exemptedMembers.length; ++i) - if (!$util.isString(message.exemptedMembers[i])) - return "exemptedMembers: string[] expected"; - } - return null; - }; - - /** - * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig - */ - AuditLogConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditLogConfig) - return object; - var message = new $root.google.iam.v1.AuditLogConfig(); - switch (object.logType) { - default: - if (typeof object.logType === "number") { - message.logType = object.logType; - break; - } - break; - case "LOG_TYPE_UNSPECIFIED": - case 0: - message.logType = 0; - break; - case "ADMIN_READ": - case 1: - message.logType = 1; - break; - case "DATA_WRITE": - case 2: - message.logType = 2; - break; - case "DATA_READ": - case 3: - message.logType = 3; - break; - } - if (object.exemptedMembers) { - if (!Array.isArray(object.exemptedMembers)) - throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); - message.exemptedMembers = []; - for (var i = 0; i < object.exemptedMembers.length; ++i) - message.exemptedMembers[i] = String(object.exemptedMembers[i]); - } - return message; - }; - - /** - * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditLogConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.exemptedMembers = []; - if (options.defaults) - object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; - if (message.exemptedMembers && message.exemptedMembers.length) { - object.exemptedMembers = []; - for (var j = 0; j < message.exemptedMembers.length; ++j) - object.exemptedMembers[j] = message.exemptedMembers[j]; - } - return object; - }; - - /** - * Converts this AuditLogConfig to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditLogConfig - * @instance - * @returns {Object.} JSON object - */ - AuditLogConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditLogConfig - * @function getTypeUrl - * @memberof google.iam.v1.AuditLogConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; - }; - - /** - * LogType enum. - * @name google.iam.v1.AuditLogConfig.LogType - * @enum {number} - * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value - * @property {number} ADMIN_READ=1 ADMIN_READ value - * @property {number} DATA_WRITE=2 DATA_WRITE value - * @property {number} DATA_READ=3 DATA_READ value - */ - AuditLogConfig.LogType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADMIN_READ"] = 1; - values[valuesById[2] = "DATA_WRITE"] = 2; - values[valuesById[3] = "DATA_READ"] = 3; - return values; - })(); - - return AuditLogConfig; - })(); - - v1.PolicyDelta = (function() { - - /** - * Properties of a PolicyDelta. - * @memberof google.iam.v1 - * @interface IPolicyDelta - * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas - * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas - */ - - /** - * Constructs a new PolicyDelta. - * @memberof google.iam.v1 - * @classdesc Represents a PolicyDelta. - * @implements IPolicyDelta - * @constructor - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - */ - function PolicyDelta(properties) { - this.bindingDeltas = []; - this.auditConfigDeltas = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PolicyDelta bindingDeltas. - * @member {Array.} bindingDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.bindingDeltas = $util.emptyArray; - - /** - * PolicyDelta auditConfigDeltas. - * @member {Array.} auditConfigDeltas - * @memberof google.iam.v1.PolicyDelta - * @instance - */ - PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; - - /** - * Creates a new PolicyDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set - * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance - */ - PolicyDelta.create = function create(properties) { - return new PolicyDelta(properties); - }; - - /** - * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bindingDeltas != null && message.bindingDeltas.length) - for (var i = 0; i < message.bindingDeltas.length; ++i) - $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) - for (var i = 0; i < message.auditConfigDeltas.length; ++i) - $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PolicyDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PolicyDelta message. - * @function verify - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PolicyDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { - if (!Array.isArray(message.bindingDeltas)) - return "bindingDeltas: array expected"; - for (var i = 0; i < message.bindingDeltas.length; ++i) { - var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); - if (error) - return "bindingDeltas." + error; - } - } - if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { - if (!Array.isArray(message.auditConfigDeltas)) - return "auditConfigDeltas: array expected"; - for (var i = 0; i < message.auditConfigDeltas.length; ++i) { - var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); - if (error) - return "auditConfigDeltas." + error; - } - } - return null; - }; - - /** - * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.PolicyDelta} PolicyDelta - */ - PolicyDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.PolicyDelta) - return object; - var message = new $root.google.iam.v1.PolicyDelta(); - if (object.bindingDeltas) { - if (!Array.isArray(object.bindingDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); - message.bindingDeltas = []; - for (var i = 0; i < object.bindingDeltas.length; ++i) { - if (typeof object.bindingDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); - message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); - } - } - if (object.auditConfigDeltas) { - if (!Array.isArray(object.auditConfigDeltas)) - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); - message.auditConfigDeltas = []; - for (var i = 0; i < object.auditConfigDeltas.length; ++i) { - if (typeof object.auditConfigDeltas[i] !== "object") - throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); - message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {google.iam.v1.PolicyDelta} message PolicyDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PolicyDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.bindingDeltas = []; - object.auditConfigDeltas = []; - } - if (message.bindingDeltas && message.bindingDeltas.length) { - object.bindingDeltas = []; - for (var j = 0; j < message.bindingDeltas.length; ++j) - object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); - } - if (message.auditConfigDeltas && message.auditConfigDeltas.length) { - object.auditConfigDeltas = []; - for (var j = 0; j < message.auditConfigDeltas.length; ++j) - object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); - } - return object; - }; - - /** - * Converts this PolicyDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.PolicyDelta - * @instance - * @returns {Object.} JSON object - */ - PolicyDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PolicyDelta - * @function getTypeUrl - * @memberof google.iam.v1.PolicyDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; - }; - - return PolicyDelta; - })(); - - v1.BindingDelta = (function() { - - /** - * Properties of a BindingDelta. - * @memberof google.iam.v1 - * @interface IBindingDelta - * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action - * @property {string|null} [role] BindingDelta role - * @property {string|null} [member] BindingDelta member - * @property {google.type.IExpr|null} [condition] BindingDelta condition - */ - - /** - * Constructs a new BindingDelta. - * @memberof google.iam.v1 - * @classdesc Represents a BindingDelta. - * @implements IBindingDelta - * @constructor - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - */ - function BindingDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BindingDelta action. - * @member {google.iam.v1.BindingDelta.Action} action - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.action = 0; - - /** - * BindingDelta role. - * @member {string} role - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.role = ""; - - /** - * BindingDelta member. - * @member {string} member - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.member = ""; - - /** - * BindingDelta condition. - * @member {google.type.IExpr|null|undefined} condition - * @memberof google.iam.v1.BindingDelta - * @instance - */ - BindingDelta.prototype.condition = null; - - /** - * Creates a new BindingDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set - * @returns {google.iam.v1.BindingDelta} BindingDelta instance - */ - BindingDelta.create = function create(properties) { - return new BindingDelta(properties); - }; - - /** - * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); - if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) - $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.role = reader.string(); - break; - } - case 3: { - message.member = reader.string(); - break; - } - case 4: { - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BindingDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.BindingDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.BindingDelta} BindingDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BindingDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BindingDelta message. - * @function verify - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BindingDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isString(message.role)) - return "role: string expected"; - if (message.member != null && message.hasOwnProperty("member")) - if (!$util.isString(message.member)) - return "member: string expected"; - if (message.condition != null && message.hasOwnProperty("condition")) { - var error = $root.google.type.Expr.verify(message.condition); - if (error) - return "condition." + error; - } - return null; - }; - - /** - * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.BindingDelta} BindingDelta - */ - BindingDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.BindingDelta) - return object; - var message = new $root.google.iam.v1.BindingDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.role != null) - message.role = String(object.role); - if (object.member != null) - message.member = String(object.member); - if (object.condition != null) { - if (typeof object.condition !== "object") - throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); - message.condition = $root.google.type.Expr.fromObject(object.condition); - } - return message; - }; - - /** - * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.BindingDelta - * @static - * @param {google.iam.v1.BindingDelta} message BindingDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BindingDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.role = ""; - object.member = ""; - object.condition = null; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.member != null && message.hasOwnProperty("member")) - object.member = message.member; - if (message.condition != null && message.hasOwnProperty("condition")) - object.condition = $root.google.type.Expr.toObject(message.condition, options); - return object; - }; - - /** - * Converts this BindingDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.BindingDelta - * @instance - * @returns {Object.} JSON object - */ - BindingDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BindingDelta - * @function getTypeUrl - * @memberof google.iam.v1.BindingDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.BindingDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.BindingDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - BindingDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return BindingDelta; - })(); - - v1.AuditConfigDelta = (function() { - - /** - * Properties of an AuditConfigDelta. - * @memberof google.iam.v1 - * @interface IAuditConfigDelta - * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action - * @property {string|null} [service] AuditConfigDelta service - * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember - * @property {string|null} [logType] AuditConfigDelta logType - */ - - /** - * Constructs a new AuditConfigDelta. - * @memberof google.iam.v1 - * @classdesc Represents an AuditConfigDelta. - * @implements IAuditConfigDelta - * @constructor - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - */ - function AuditConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuditConfigDelta action. - * @member {google.iam.v1.AuditConfigDelta.Action} action - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.action = 0; - - /** - * AuditConfigDelta service. - * @member {string} service - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.service = ""; - - /** - * AuditConfigDelta exemptedMember. - * @member {string} exemptedMember - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.exemptedMember = ""; - - /** - * AuditConfigDelta logType. - * @member {string} logType - * @memberof google.iam.v1.AuditConfigDelta - * @instance - */ - AuditConfigDelta.prototype.logType = ""; - - /** - * Creates a new AuditConfigDelta instance using the specified properties. - * @function create - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance - */ - AuditConfigDelta.create = function create(properties) { - return new AuditConfigDelta(properties); - }; - - /** - * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); - if (message.service != null && Object.hasOwnProperty.call(message, "service")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); - if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); - if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); - return writer; - }; - - /** - * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. - * @function encodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer. - * @function decode - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.action = reader.int32(); - break; - } - case 2: { - message.service = reader.string(); - break; - } - case 3: { - message.exemptedMember = reader.string(); - break; - } - case 4: { - message.logType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuditConfigDelta message. - * @function verify - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuditConfigDelta.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.service != null && message.hasOwnProperty("service")) - if (!$util.isString(message.service)) - return "service: string expected"; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - if (!$util.isString(message.exemptedMember)) - return "exemptedMember: string expected"; - if (message.logType != null && message.hasOwnProperty("logType")) - if (!$util.isString(message.logType)) - return "logType: string expected"; - return null; - }; - - /** - * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta - */ - AuditConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.iam.v1.AuditConfigDelta) - return object; - var message = new $root.google.iam.v1.AuditConfigDelta(); - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "ACTION_UNSPECIFIED": - case 0: - message.action = 0; - break; - case "ADD": - case 1: - message.action = 1; - break; - case "REMOVE": - case 2: - message.action = 2; - break; - } - if (object.service != null) - message.service = String(object.service); - if (object.exemptedMember != null) - message.exemptedMember = String(object.exemptedMember); - if (object.logType != null) - message.logType = String(object.logType); - return message; - }; - - /** - * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuditConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; - object.service = ""; - object.exemptedMember = ""; - object.logType = ""; - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; - if (message.service != null && message.hasOwnProperty("service")) - object.service = message.service; - if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) - object.exemptedMember = message.exemptedMember; - if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = message.logType; - return object; - }; - - /** - * Converts this AuditConfigDelta to JSON. - * @function toJSON - * @memberof google.iam.v1.AuditConfigDelta - * @instance - * @returns {Object.} JSON object - */ - AuditConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuditConfigDelta - * @function getTypeUrl - * @memberof google.iam.v1.AuditConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; - }; - - /** - * Action enum. - * @name google.iam.v1.AuditConfigDelta.Action - * @enum {number} - * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value - * @property {number} ADD=1 ADD value - * @property {number} REMOVE=2 REMOVE value - */ - AuditConfigDelta.Action = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ADD"] = 1; - values[valuesById[2] = "REMOVE"] = 2; - return values; - })(); - - return AuditConfigDelta; - })(); - - return v1; - })(); - - return iam; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Expr = (function() { - - /** - * Properties of an Expr. - * @memberof google.type - * @interface IExpr - * @property {string|null} [expression] Expr expression - * @property {string|null} [title] Expr title - * @property {string|null} [description] Expr description - * @property {string|null} [location] Expr location - */ - - /** - * Constructs a new Expr. - * @memberof google.type - * @classdesc Represents an Expr. - * @implements IExpr - * @constructor - * @param {google.type.IExpr=} [properties] Properties to set - */ - function Expr(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Expr expression. - * @member {string} expression - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.expression = ""; - - /** - * Expr title. - * @member {string} title - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.title = ""; - - /** - * Expr description. - * @member {string} description - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.description = ""; - - /** - * Expr location. - * @member {string} location - * @memberof google.type.Expr - * @instance - */ - Expr.prototype.location = ""; - - /** - * Creates a new Expr instance using the specified properties. - * @function create - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr=} [properties] Properties to set - * @returns {google.type.Expr} Expr instance - */ - Expr.create = function create(properties) { - return new Expr(properties); - }; - - /** - * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encode - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); - return writer; - }; - - /** - * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Expr - * @static - * @param {google.type.IExpr} message Expr message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Expr.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Expr message from the specified reader or buffer. - * @function decode - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decode = function 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.Expr(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.expression = reader.string(); - break; - } - case 2: { - message.title = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.location = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Expr message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Expr - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Expr} Expr - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Expr.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Expr message. - * @function verify - * @memberof google.type.Expr - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Expr.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.expression != null && message.hasOwnProperty("expression")) - if (!$util.isString(message.expression)) - return "expression: 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.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - return null; - }; - - /** - * Creates an Expr message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Expr - * @static - * @param {Object.} object Plain object - * @returns {google.type.Expr} Expr - */ - Expr.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Expr) - return object; - var message = new $root.google.type.Expr(); - if (object.expression != null) - message.expression = String(object.expression); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.location != null) - message.location = String(object.location); - return message; - }; - - /** - * Creates a plain object from an Expr message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Expr - * @static - * @param {google.type.Expr} message Expr - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Expr.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.expression = ""; - object.title = ""; - object.description = ""; - object.location = ""; - } - if (message.expression != null && message.hasOwnProperty("expression")) - object.expression = message.expression; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - return object; - }; - - /** - * Converts this Expr to JSON. - * @function toJSON - * @memberof google.type.Expr - * @instance - * @returns {Object.} JSON object - */ - Expr.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Expr - * @function getTypeUrl - * @memberof google.type.Expr - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Expr"; - }; - - return Expr; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/protos/protos.json b/protos/protos.json deleted file mode 100644 index 1b65fc18..00000000 --- a/protos/protos.json +++ /dev/null @@ -1,4504 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "tasks": { - "nested": { - "v2": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/tasks/v2;tasks", - "java_multiple_files": true, - "java_outer_classname": "TaskProto", - "java_package": "com.google.cloud.tasks.v2", - "objc_class_prefix": "TASKS" - }, - "nested": { - "CloudTasks": { - "options": { - "(google.api.default_host)": "cloudtasks.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListQueues": { - "requestType": "ListQueuesRequest", - "responseType": "ListQueuesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*}/queues", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*}/queues" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetQueue": { - "requestType": "GetQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/queues/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/queues/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateQueue": { - "requestType": "CreateQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*}/queues", - "(google.api.http).body": "queue", - "(google.api.method_signature)": "parent,queue" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*}/queues", - "body": "queue" - } - }, - { - "(google.api.method_signature)": "parent,queue" - } - ] - }, - "UpdateQueue": { - "requestType": "UpdateQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).patch": "/v2/{queue.name=projects/*/locations/*/queues/*}", - "(google.api.http).body": "queue", - "(google.api.method_signature)": "queue,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{queue.name=projects/*/locations/*/queues/*}", - "body": "queue" - } - }, - { - "(google.api.method_signature)": "queue,update_mask" - } - ] - }, - "DeleteQueue": { - "requestType": "DeleteQueueRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/queues/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/queues/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "PurgeQueue": { - "requestType": "PurgeQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/queues/*}:purge", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/queues/*}:purge", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "PauseQueue": { - "requestType": "PauseQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/queues/*}:pause", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/queues/*}:pause", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ResumeQueue": { - "requestType": "ResumeQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/queues/*}:resume", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/queues/*}:resume", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/queues/*}:getIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/queues/*}:setIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{resource=projects/*/locations/*/queues/*}:testIamPermissions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/locations/*/queues/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/locations/*/queues/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/locations/*/queues/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/locations/*/queues/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateTask": { - "requestType": "CreateTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/locations/*/queues/*}/tasks", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,task" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/locations/*/queues/*}/tasks", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,task" - } - ] - }, - "DeleteTask": { - "requestType": "DeleteTaskRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/locations/*/queues/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/locations/*/queues/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "RunTask": { - "requestType": "RunTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{name=projects/*/locations/*/queues/*/tasks/*}:run", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListQueuesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Queue" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListQueuesResponse": { - "fields": { - "queues": { - "rule": "repeated", - "type": "Queue", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "CreateQueueRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Queue" - } - }, - "queue": { - "type": "Queue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateQueueRequest": { - "fields": { - "queue": { - "type": "Queue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "PurgeQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "PauseQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "ResumeQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - } - } - }, - "CreateTaskRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "task": { - "type": "Task", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "responseView": { - "type": "Task.View", - "id": 3 - } - } - }, - "DeleteTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - } - } - }, - "RunTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - } - } - }, - "Queue": { - "options": { - "(google.api.resource).type": "cloudtasks.googleapis.com/Queue", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/queues/{queue}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "appEngineRoutingOverride": { - "type": "AppEngineRouting", - "id": 2 - }, - "rateLimits": { - "type": "RateLimits", - "id": 3 - }, - "retryConfig": { - "type": "RetryConfig", - "id": 4 - }, - "state": { - "type": "State", - "id": 5 - }, - "purgeTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - }, - "stackdriverLoggingConfig": { - "type": "StackdriverLoggingConfig", - "id": 9 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "PAUSED": 2, - "DISABLED": 3 - } - } - } - }, - "RateLimits": { - "fields": { - "maxDispatchesPerSecond": { - "type": "double", - "id": 1 - }, - "maxBurstSize": { - "type": "int32", - "id": 2 - }, - "maxConcurrentDispatches": { - "type": "int32", - "id": 3 - } - } - }, - "RetryConfig": { - "fields": { - "maxAttempts": { - "type": "int32", - "id": 1 - }, - "maxRetryDuration": { - "type": "google.protobuf.Duration", - "id": 2 - }, - "minBackoff": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "maxBackoff": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxDoublings": { - "type": "int32", - "id": 5 - } - } - }, - "StackdriverLoggingConfig": { - "fields": { - "samplingRatio": { - "type": "double", - "id": 1 - } - } - }, - "HttpRequest": { - "oneofs": { - "authorizationHeader": { - "oneof": [ - "oauthToken", - "oidcToken" - ] - } - }, - "fields": { - "url": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "httpMethod": { - "type": "HttpMethod", - "id": 2 - }, - "headers": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "body": { - "type": "bytes", - "id": 4 - }, - "oauthToken": { - "type": "OAuthToken", - "id": 5 - }, - "oidcToken": { - "type": "OidcToken", - "id": 6 - } - } - }, - "AppEngineHttpRequest": { - "fields": { - "httpMethod": { - "type": "HttpMethod", - "id": 1 - }, - "appEngineRouting": { - "type": "AppEngineRouting", - "id": 2 - }, - "relativeUri": { - "type": "string", - "id": 3 - }, - "headers": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "body": { - "type": "bytes", - "id": 5 - } - } - }, - "AppEngineRouting": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "instance": { - "type": "string", - "id": 3 - }, - "host": { - "type": "string", - "id": 4 - } - } - }, - "HttpMethod": { - "values": { - "HTTP_METHOD_UNSPECIFIED": 0, - "POST": 1, - "GET": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5, - "PATCH": 6, - "OPTIONS": 7 - } - }, - "OAuthToken": { - "fields": { - "serviceAccountEmail": { - "type": "string", - "id": 1 - }, - "scope": { - "type": "string", - "id": 2 - } - } - }, - "OidcToken": { - "fields": { - "serviceAccountEmail": { - "type": "string", - "id": 1 - }, - "audience": { - "type": "string", - "id": 2 - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "cloudtasks.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" - }, - "oneofs": { - "messageType": { - "oneof": [ - "appEngineHttpRequest", - "httpRequest" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "appEngineHttpRequest": { - "type": "AppEngineHttpRequest", - "id": 2 - }, - "httpRequest": { - "type": "HttpRequest", - "id": 3 - }, - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "dispatchDeadline": { - "type": "google.protobuf.Duration", - "id": 6 - }, - "dispatchCount": { - "type": "int32", - "id": 7 - }, - "responseCount": { - "type": "int32", - "id": 8 - }, - "firstAttempt": { - "type": "Attempt", - "id": 9 - }, - "lastAttempt": { - "type": "Attempt", - "id": 10 - }, - "view": { - "type": "View", - "id": 11 - } - }, - "nested": { - "View": { - "values": { - "VIEW_UNSPECIFIED": 0, - "BASIC": 1, - "FULL": 2 - } - } - } - }, - "Attempt": { - "fields": { - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "dispatchTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "responseTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "responseStatus": { - "type": "google.rpc.Status", - "id": 4 - } - } - } - } - }, - "v2beta2": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/tasks/v2beta2;tasks", - "java_multiple_files": true, - "java_outer_classname": "TaskProto", - "java_package": "com.google.cloud.tasks.v2beta2", - "objc_class_prefix": "TASKS" - }, - "nested": { - "CloudTasks": { - "options": { - "(google.api.default_host)": "cloudtasks.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListQueues": { - "requestType": "ListQueuesRequest", - "responseType": "ListQueuesResponse", - "options": { - "(google.api.http).get": "/v2beta2/{parent=projects/*/locations/*}/queues", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta2/{parent=projects/*/locations/*}/queues" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetQueue": { - "requestType": "GetQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).get": "/v2beta2/{name=projects/*/locations/*/queues/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta2/{name=projects/*/locations/*/queues/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateQueue": { - "requestType": "CreateQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta2/{parent=projects/*/locations/*}/queues", - "(google.api.http).body": "queue", - "(google.api.method_signature)": "parent,queue" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{parent=projects/*/locations/*}/queues", - "body": "queue" - } - }, - { - "(google.api.method_signature)": "parent,queue" - } - ] - }, - "UpdateQueue": { - "requestType": "UpdateQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).patch": "/v2beta2/{queue.name=projects/*/locations/*/queues/*}", - "(google.api.http).body": "queue", - "(google.api.method_signature)": "queue,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta2/{queue.name=projects/*/locations/*/queues/*}", - "body": "queue" - } - }, - { - "(google.api.method_signature)": "queue,update_mask" - } - ] - }, - "DeleteQueue": { - "requestType": "DeleteQueueRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta2/{name=projects/*/locations/*/queues/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta2/{name=projects/*/locations/*/queues/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "PurgeQueue": { - "requestType": "PurgeQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*}:purge", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*}:purge", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "PauseQueue": { - "requestType": "PauseQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*}:pause", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*}:pause", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ResumeQueue": { - "requestType": "ResumeQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*}:resume", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*}:resume", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{resource=projects/*/locations/*/queues/*}:getIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{resource=projects/*/locations/*/queues/*}:setIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{resource=projects/*/locations/*/queues/*}:testIamPermissions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateTask": { - "requestType": "CreateTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,task" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,task" - } - ] - }, - "DeleteTask": { - "requestType": "DeleteTaskRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "LeaseTasks": { - "requestType": "LeaseTasksRequest", - "responseType": "LeaseTasksResponse", - "options": { - "(google.api.http).post": "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,lease_duration" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{parent=projects/*/locations/*/queues/*}/tasks:lease", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,lease_duration" - } - ] - }, - "AcknowledgeTask": { - "requestType": "AcknowledgeTaskRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,schedule_time" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:acknowledge", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,schedule_time" - } - ] - }, - "RenewLease": { - "requestType": "RenewLeaseRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,schedule_time,lease_duration" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:renewLease", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,schedule_time,lease_duration" - } - ] - }, - "CancelLease": { - "requestType": "CancelLeaseRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,schedule_time" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:cancelLease", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,schedule_time" - } - ] - }, - "RunTask": { - "requestType": "RunTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta2/{name=projects/*/locations/*/queues/*/tasks/*}:run", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListQueuesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Queue" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListQueuesResponse": { - "fields": { - "queues": { - "rule": "repeated", - "type": "Queue", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateQueueRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Queue" - } - }, - "queue": { - "type": "Queue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateQueueRequest": { - "fields": { - "queue": { - "type": "Queue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "PurgeQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "PauseQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "ResumeQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - } - } - }, - "CreateTaskRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "task": { - "type": "Task", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "responseView": { - "type": "Task.View", - "id": 3 - } - } - }, - "DeleteTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - } - } - }, - "LeaseTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "maxTasks": { - "type": "int32", - "id": 2 - }, - "leaseDuration": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "responseView": { - "type": "Task.View", - "id": 4 - }, - "filter": { - "type": "string", - "id": 5 - } - } - }, - "LeaseTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - } - } - }, - "AcknowledgeTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RenewLeaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "leaseDuration": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "responseView": { - "type": "Task.View", - "id": 4 - } - } - }, - "CancelLeaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "responseView": { - "type": "Task.View", - "id": 3 - } - } - }, - "RunTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - } - } - }, - "Queue": { - "options": { - "(google.api.resource).type": "cloudtasks.googleapis.com/Queue", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/queues/{queue}" - }, - "oneofs": { - "targetType": { - "oneof": [ - "appEngineHttpTarget", - "pullTarget" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "appEngineHttpTarget": { - "type": "AppEngineHttpTarget", - "id": 3 - }, - "pullTarget": { - "type": "PullTarget", - "id": 4 - }, - "rateLimits": { - "type": "RateLimits", - "id": 5 - }, - "retryConfig": { - "type": "RetryConfig", - "id": 6 - }, - "state": { - "type": "State", - "id": 7 - }, - "purgeTime": { - "type": "google.protobuf.Timestamp", - "id": 8 - }, - "taskTtl": { - "type": "google.protobuf.Duration", - "id": 9 - }, - "tombstoneTtl": { - "type": "google.protobuf.Duration", - "id": 10 - }, - "stats": { - "type": "QueueStats", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "PAUSED": 2, - "DISABLED": 3 - } - } - } - }, - "RateLimits": { - "fields": { - "maxTasksDispatchedPerSecond": { - "type": "double", - "id": 1 - }, - "maxBurstSize": { - "type": "int32", - "id": 2 - }, - "maxConcurrentTasks": { - "type": "int32", - "id": 3 - } - } - }, - "RetryConfig": { - "oneofs": { - "numAttempts": { - "oneof": [ - "maxAttempts", - "unlimitedAttempts" - ] - } - }, - "fields": { - "maxAttempts": { - "type": "int32", - "id": 1 - }, - "unlimitedAttempts": { - "type": "bool", - "id": 2 - }, - "maxRetryDuration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "minBackoff": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxBackoff": { - "type": "google.protobuf.Duration", - "id": 5 - }, - "maxDoublings": { - "type": "int32", - "id": 6 - } - } - }, - "QueueStats": { - "fields": { - "tasksCount": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "oldestEstimatedArrivalTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executedLastMinuteCount": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "concurrentDispatchesCount": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "effectiveExecutionRate": { - "type": "double", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PullTarget": { - "fields": {} - }, - "PullMessage": { - "fields": { - "payload": { - "type": "bytes", - "id": 1 - }, - "tag": { - "type": "string", - "id": 2 - } - } - }, - "AppEngineHttpTarget": { - "fields": { - "appEngineRoutingOverride": { - "type": "AppEngineRouting", - "id": 1 - } - } - }, - "AppEngineHttpRequest": { - "fields": { - "httpMethod": { - "type": "HttpMethod", - "id": 1 - }, - "appEngineRouting": { - "type": "AppEngineRouting", - "id": 2 - }, - "relativeUrl": { - "type": "string", - "id": 3 - }, - "headers": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "payload": { - "type": "bytes", - "id": 5 - } - } - }, - "AppEngineRouting": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "instance": { - "type": "string", - "id": 3 - }, - "host": { - "type": "string", - "id": 4 - } - } - }, - "HttpMethod": { - "values": { - "HTTP_METHOD_UNSPECIFIED": 0, - "POST": 1, - "GET": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5 - } - }, - "Task": { - "options": { - "(google.api.resource).type": "cloudtasks.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" - }, - "oneofs": { - "payloadType": { - "oneof": [ - "appEngineHttpRequest", - "pullMessage" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "appEngineHttpRequest": { - "type": "AppEngineHttpRequest", - "id": 3 - }, - "pullMessage": { - "type": "PullMessage", - "id": 4 - }, - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - }, - "status": { - "type": "TaskStatus", - "id": 7 - }, - "view": { - "type": "View", - "id": 8 - } - }, - "nested": { - "View": { - "values": { - "VIEW_UNSPECIFIED": 0, - "BASIC": 1, - "FULL": 2 - } - } - } - }, - "TaskStatus": { - "fields": { - "attemptDispatchCount": { - "type": "int32", - "id": 1 - }, - "attemptResponseCount": { - "type": "int32", - "id": 2 - }, - "firstAttemptStatus": { - "type": "AttemptStatus", - "id": 3 - }, - "lastAttemptStatus": { - "type": "AttemptStatus", - "id": 4 - } - } - }, - "AttemptStatus": { - "fields": { - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "dispatchTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "responseTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "responseStatus": { - "type": "google.rpc.Status", - "id": 4 - } - } - } - } - }, - "v2beta3": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/cloud/tasks/v2beta3;tasks", - "java_multiple_files": true, - "java_outer_classname": "TaskProto", - "java_package": "com.google.cloud.tasks.v2beta3", - "objc_class_prefix": "TASKS" - }, - "nested": { - "CloudTasks": { - "options": { - "(google.api.default_host)": "cloudtasks.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListQueues": { - "requestType": "ListQueuesRequest", - "responseType": "ListQueuesResponse", - "options": { - "(google.api.http).get": "/v2beta3/{parent=projects/*/locations/*}/queues", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta3/{parent=projects/*/locations/*}/queues" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetQueue": { - "requestType": "GetQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).get": "/v2beta3/{name=projects/*/locations/*/queues/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta3/{name=projects/*/locations/*/queues/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateQueue": { - "requestType": "CreateQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta3/{parent=projects/*/locations/*}/queues", - "(google.api.http).body": "queue", - "(google.api.method_signature)": "parent,queue" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{parent=projects/*/locations/*}/queues", - "body": "queue" - } - }, - { - "(google.api.method_signature)": "parent,queue" - } - ] - }, - "UpdateQueue": { - "requestType": "UpdateQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).patch": "/v2beta3/{queue.name=projects/*/locations/*/queues/*}", - "(google.api.http).body": "queue", - "(google.api.method_signature)": "queue,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta3/{queue.name=projects/*/locations/*/queues/*}", - "body": "queue" - } - }, - { - "(google.api.method_signature)": "queue,update_mask" - } - ] - }, - "DeleteQueue": { - "requestType": "DeleteQueueRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta3/{name=projects/*/locations/*/queues/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta3/{name=projects/*/locations/*/queues/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "PurgeQueue": { - "requestType": "PurgeQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta3/{name=projects/*/locations/*/queues/*}:purge", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{name=projects/*/locations/*/queues/*}:purge", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "PauseQueue": { - "requestType": "PauseQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta3/{name=projects/*/locations/*/queues/*}:pause", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{name=projects/*/locations/*/queues/*}:pause", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ResumeQueue": { - "requestType": "ResumeQueueRequest", - "responseType": "Queue", - "options": { - "(google.api.http).post": "/v2beta3/{name=projects/*/locations/*/queues/*}:resume", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{name=projects/*/locations/*/queues/*}:resume", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "GetIamPolicy": { - "requestType": "google.iam.v1.GetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{resource=projects/*/locations/*/queues/*}:getIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource" - } - ] - }, - "SetIamPolicy": { - "requestType": "google.iam.v1.SetIamPolicyRequest", - "responseType": "google.iam.v1.Policy", - "options": { - "(google.api.http).post": "/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{resource=projects/*/locations/*/queues/*}:setIamPolicy", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,policy" - } - ] - }, - "TestIamPermissions": { - "requestType": "google.iam.v1.TestIamPermissionsRequest", - "responseType": "google.iam.v1.TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions", - "(google.api.http).body": "*", - "(google.api.method_signature)": "resource,permissions" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{resource=projects/*/locations/*/queues/*}:testIamPermissions", - "body": "*" - } - }, - { - "(google.api.method_signature)": "resource,permissions" - } - ] - }, - "ListTasks": { - "requestType": "ListTasksRequest", - "responseType": "ListTasksResponse", - "options": { - "(google.api.http).get": "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetTask": { - "requestType": "GetTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).get": "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateTask": { - "requestType": "CreateTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,task" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{parent=projects/*/locations/*/queues/*}/tasks", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,task" - } - ] - }, - "DeleteTask": { - "requestType": "DeleteTaskRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "RunTask": { - "requestType": "RunTaskRequest", - "responseType": "Task", - "options": { - "(google.api.http).post": "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "ListQueuesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Queue" - } - }, - "filter": { - "type": "string", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListQueuesResponse": { - "fields": { - "queues": { - "rule": "repeated", - "type": "Queue", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - }, - "readMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateQueueRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Queue" - } - }, - "queue": { - "type": "Queue", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateQueueRequest": { - "fields": { - "queue": { - "type": "Queue", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 - } - } - }, - "DeleteQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "PurgeQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "PauseQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "ResumeQueueRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Queue" - } - } - } - }, - "ListTasksRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - }, - "pageSize": { - "type": "int32", - "id": 3 - }, - "pageToken": { - "type": "string", - "id": 4 - } - } - }, - "ListTasksResponse": { - "fields": { - "tasks": { - "rule": "repeated", - "type": "Task", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - } - } - }, - "CreateTaskRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "cloudtasks.googleapis.com/Task" - } - }, - "task": { - "type": "Task", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "responseView": { - "type": "Task.View", - "id": 3 - } - } - }, - "DeleteTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - } - } - }, - "RunTaskRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudtasks.googleapis.com/Task" - } - }, - "responseView": { - "type": "Task.View", - "id": 2 - } - } - }, - "Queue": { - "options": { - "(google.api.resource).type": "cloudtasks.googleapis.com/Queue", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/queues/{queue}" - }, - "oneofs": { - "queueType": { - "oneof": [ - "appEngineHttpQueue" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "appEngineHttpQueue": { - "type": "AppEngineHttpQueue", - "id": 3 - }, - "rateLimits": { - "type": "RateLimits", - "id": 4 - }, - "retryConfig": { - "type": "RetryConfig", - "id": 5 - }, - "state": { - "type": "State", - "id": 6 - }, - "purgeTime": { - "type": "google.protobuf.Timestamp", - "id": 7 - }, - "taskTtl": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "tombstoneTtl": { - "type": "google.protobuf.Duration", - "id": 9 - }, - "stackdriverLoggingConfig": { - "type": "StackdriverLoggingConfig", - "id": 10 - }, - "type": { - "type": "Type", - "id": 11, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "stats": { - "type": "QueueStats", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "PAUSED": 2, - "DISABLED": 3 - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "PULL": 1, - "PUSH": 2 - } - } - } - }, - "RateLimits": { - "fields": { - "maxDispatchesPerSecond": { - "type": "double", - "id": 1 - }, - "maxBurstSize": { - "type": "int32", - "id": 2 - }, - "maxConcurrentDispatches": { - "type": "int32", - "id": 3 - } - } - }, - "RetryConfig": { - "fields": { - "maxAttempts": { - "type": "int32", - "id": 1 - }, - "maxRetryDuration": { - "type": "google.protobuf.Duration", - "id": 2 - }, - "minBackoff": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "maxBackoff": { - "type": "google.protobuf.Duration", - "id": 4 - }, - "maxDoublings": { - "type": "int32", - "id": 5 - } - } - }, - "StackdriverLoggingConfig": { - "fields": { - "samplingRatio": { - "type": "double", - "id": 1 - } - } - }, - "QueueStats": { - "fields": { - "tasksCount": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "oldestEstimatedArrivalTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "executedLastMinuteCount": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "concurrentDispatchesCount": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "effectiveExecutionRate": { - "type": "double", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "PullMessage": { - "fields": { - "payload": { - "type": "bytes", - "id": 1 - }, - "tag": { - "type": "string", - "id": 2 - } - } - }, - "HttpRequest": { - "oneofs": { - "authorizationHeader": { - "oneof": [ - "oauthToken", - "oidcToken" - ] - } - }, - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "httpMethod": { - "type": "HttpMethod", - "id": 2 - }, - "headers": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "body": { - "type": "bytes", - "id": 4 - }, - "oauthToken": { - "type": "OAuthToken", - "id": 5 - }, - "oidcToken": { - "type": "OidcToken", - "id": 6 - } - } - }, - "AppEngineHttpQueue": { - "fields": { - "appEngineRoutingOverride": { - "type": "AppEngineRouting", - "id": 1 - } - } - }, - "AppEngineHttpRequest": { - "fields": { - "httpMethod": { - "type": "HttpMethod", - "id": 1 - }, - "appEngineRouting": { - "type": "AppEngineRouting", - "id": 2 - }, - "relativeUri": { - "type": "string", - "id": 3 - }, - "headers": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "body": { - "type": "bytes", - "id": 5 - } - } - }, - "AppEngineRouting": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "instance": { - "type": "string", - "id": 3 - }, - "host": { - "type": "string", - "id": 4 - } - } - }, - "HttpMethod": { - "values": { - "HTTP_METHOD_UNSPECIFIED": 0, - "POST": 1, - "GET": 2, - "HEAD": 3, - "PUT": 4, - "DELETE": 5, - "PATCH": 6, - "OPTIONS": 7 - } - }, - "OAuthToken": { - "fields": { - "serviceAccountEmail": { - "type": "string", - "id": 1 - }, - "scope": { - "type": "string", - "id": 2 - } - } - }, - "OidcToken": { - "fields": { - "serviceAccountEmail": { - "type": "string", - "id": 1 - }, - "audience": { - "type": "string", - "id": 2 - } - } - }, - "Task": { - "options": { - "(google.api.resource).type": "cloudtasks.googleapis.com/Task", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}" - }, - "oneofs": { - "payloadType": { - "oneof": [ - "appEngineHttpRequest", - "httpRequest", - "pullMessage" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "appEngineHttpRequest": { - "type": "AppEngineHttpRequest", - "id": 3 - }, - "httpRequest": { - "type": "HttpRequest", - "id": 11 - }, - "pullMessage": { - "type": "PullMessage", - "id": 13 - }, - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "dispatchDeadline": { - "type": "google.protobuf.Duration", - "id": 12 - }, - "dispatchCount": { - "type": "int32", - "id": 6 - }, - "responseCount": { - "type": "int32", - "id": 7 - }, - "firstAttempt": { - "type": "Attempt", - "id": 8 - }, - "lastAttempt": { - "type": "Attempt", - "id": 9 - }, - "view": { - "type": "View", - "id": 10 - } - }, - "nested": { - "View": { - "values": { - "VIEW_UNSPECIFIED": 0, - "BASIC": 1, - "FULL": 2 - } - } - } - }, - "Attempt": { - "fields": { - "scheduleTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "dispatchTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "responseTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "responseStatus": { - "type": "google.rpc.Status", - "id": 4 - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions" - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7 - } - }, - "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 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "FileDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10, - "options": { - "packed": false - } - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11, - "options": { - "packed": false - } - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "string", - "id": 13 - } - } - }, - "DescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "FieldDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, - "LABEL_REPEATED": 3 - } - } - } - }, - "OneofDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "phpGenericServices": { - "type": "bool", - "id": 42, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - } - } - }, - "OneofOptions": { - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2 - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1 - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Empty": { - "fields": {} - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "iam": { - "nested": { - "v1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Iam.V1", - "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", - "java_multiple_files": true, - "java_outer_classname": "PolicyProto", - "java_package": "com.google.iam.v1", - "php_namespace": "Google\\Cloud\\Iam\\V1" - }, - "nested": { - "IAMPolicy": { - "options": { - "(google.api.default_host)": "iam-meta-api.googleapis.com" - }, - "methods": { - "SetIamPolicy": { - "requestType": "SetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:setIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:setIamPolicy", - "body": "*" - } - } - ] - }, - "GetIamPolicy": { - "requestType": "GetIamPolicyRequest", - "responseType": "Policy", - "options": { - "(google.api.http).post": "/v1/{resource=**}:getIamPolicy", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:getIamPolicy", - "body": "*" - } - } - ] - }, - "TestIamPermissions": { - "requestType": "TestIamPermissionsRequest", - "responseType": "TestIamPermissionsResponse", - "options": { - "(google.api.http).post": "/v1/{resource=**}:testIamPermissions", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{resource=**}:testIamPermissions", - "body": "*" - } - } - ] - } - } - }, - "SetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "policy": { - "type": "Policy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3 - } - } - }, - "GetIamPolicyRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "options": { - "type": "GetPolicyOptions", - "id": 2 - } - } - }, - "TestIamPermissionsRequest": { - "fields": { - "resource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "*" - } - }, - "permissions": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "TestIamPermissionsResponse": { - "fields": { - "permissions": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "GetPolicyOptions": { - "fields": { - "requestedPolicyVersion": { - "type": "int32", - "id": 1 - } - } - }, - "Policy": { - "fields": { - "version": { - "type": "int32", - "id": 1 - }, - "bindings": { - "rule": "repeated", - "type": "Binding", - "id": 4 - }, - "auditConfigs": { - "rule": "repeated", - "type": "AuditConfig", - "id": 6 - }, - "etag": { - "type": "bytes", - "id": 3 - } - } - }, - "Binding": { - "fields": { - "role": { - "type": "string", - "id": 1 - }, - "members": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "condition": { - "type": "google.type.Expr", - "id": 3 - } - } - }, - "AuditConfig": { - "fields": { - "service": { - "type": "string", - "id": 1 - }, - "auditLogConfigs": { - "rule": "repeated", - "type": "AuditLogConfig", - "id": 3 - } - } - }, - "AuditLogConfig": { - "fields": { - "logType": { - "type": "LogType", - "id": 1 - }, - "exemptedMembers": { - "rule": "repeated", - "type": "string", - "id": 2 - } - }, - "nested": { - "LogType": { - "values": { - "LOG_TYPE_UNSPECIFIED": 0, - "ADMIN_READ": 1, - "DATA_WRITE": 2, - "DATA_READ": 3 - } - } - } - }, - "PolicyDelta": { - "fields": { - "bindingDeltas": { - "rule": "repeated", - "type": "BindingDelta", - "id": 1 - }, - "auditConfigDeltas": { - "rule": "repeated", - "type": "AuditConfigDelta", - "id": 2 - } - } - }, - "BindingDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "role": { - "type": "string", - "id": 2 - }, - "member": { - "type": "string", - "id": 3 - }, - "condition": { - "type": "google.type.Expr", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - }, - "AuditConfigDelta": { - "fields": { - "action": { - "type": "Action", - "id": 1 - }, - "service": { - "type": "string", - "id": 2 - }, - "exemptedMember": { - "type": "string", - "id": 3 - }, - "logType": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Action": { - "values": { - "ACTION_UNSPECIFIED": 0, - "ADD": 1, - "REMOVE": 2 - } - } - } - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", - "java_multiple_files": true, - "java_outer_classname": "ExprProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Expr": { - "fields": { - "expression": { - "type": "string", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "location": { - "type": "string", - "id": 4 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 26428fcf..00000000 --- a/renovate.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": [ - "config:base", - "docker:disable", - ":disableDependencyDashboard" - ], - "pinVersions": false, - "rebaseStalePrs": true, - "schedule": [ - "after 9am and before 3pm" - ], - "gitAuthor": null, - "packageRules": [ - { - "extends": "packages:linters", - "groupName": "linters" - } - ], - "ignoreDeps": ["typescript"] -} diff --git a/samples/.eslintrc.yml b/samples/.eslintrc.yml deleted file mode 100644 index 282535f5..00000000 --- a/samples/.eslintrc.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -rules: - no-console: off diff --git a/samples/Dockerfile b/samples/Dockerfile deleted file mode 100644 index 9ff85bca..00000000 --- a/samples/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# Use the official Node.js 10 image. -# https://hub.docker.com/_/node -FROM node:10 - -# Create and change to the app directory. -WORKDIR /usr/src/app - -# Copy application dependency manifests to the container image. -# A wildcard is used to ensure both package.json AND package-lock.json are copied. -# Copying this separately prevents re-running npm install on every code change. -COPY package.json package*.json ./ - -# Install production dependencies. -RUN npm install --only=production - -# Copy local code to the container image. -COPY . . - -# Run the web service on container startup. -CMD [ "npm", "start" ] diff --git a/samples/README.md b/samples/README.md deleted file mode 100644 index 8fd91a78..00000000 --- a/samples/README.md +++ /dev/null @@ -1,182 +0,0 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Cloud Tasks: Node.js Samples](https://github.com/googleapis/nodejs-tasks) - -[![Open in Cloud Shell][shell_img]][shell_link] - - - -## Table of Contents - -* [Before you begin](#before-you-begin) -* [Samples](#samples) - * [Cloud Tasks Create HTTP Target](#cloud-tasks-create-http-target) - * [Cloud Tasks Create HTTP Target with Token](#cloud-tasks-create-http-target-with-token) - * [Create Queue](#create-queue) - * [Cloud Tasks Create App Engine Target](#cloud-tasks-create-app-engine-target) - * [Delete Queue](#delete-queue) - * [List Queues](#list-queues) - * [Quickstart](#quickstart) - * [Server](#server) - -## Before you begin - -Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-tasks#using-the-client-library). - -`cd samples` - -`npm install` - -`cd ..` - -## Samples - - - -### Cloud Tasks Create HTTP Target - -Create Cloud Tasks with a HTTP Target - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/createHttpTask.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createHttpTask.js,samples/README.md) - -__Usage:__ - - -`node createHttpTask.js ` - - ------ - - - - -### Cloud Tasks Create HTTP Target with Token - -Create Cloud Tasks with a HTTP Target with Token - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/createHttpTaskWithToken.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createHttpTaskWithToken.js,samples/README.md) - -__Usage:__ - - -`node createHttpTaskWithToken.js ` - - ------ - - - - -### Create Queue - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/createQueue.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createQueue.js,samples/README.md) - -__Usage:__ - - -`node samples/createQueue.js` - - ------ - - - - -### Cloud Tasks Create App Engine Target - -Create Cloud Tasks with a Google App Engine Target - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/createTask.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/createTask.js,samples/README.md) - -__Usage:__ - - -`node createTask.js ` - - ------ - - - - -### Delete Queue - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/deleteQueue.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/deleteQueue.js,samples/README.md) - -__Usage:__ - - -`node samples/deleteQueue.js` - - ------ - - - - -### List Queues - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/listQueues.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/listQueues.js,samples/README.md) - -__Usage:__ - - -`node samples/listQueues.js` - - ------ - - - - -### Quickstart - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/quickstart.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) - -__Usage:__ - - -`node samples/quickstart.js` - - ------ - - - - -### Server - -View the [source code](https://github.com/googleapis/nodejs-tasks/blob/main/samples/server.js). - -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/server.js,samples/README.md) - -__Usage:__ - - -`node samples/server.js` - - - - - - -[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-tasks&page=editor&open_in_editor=samples/README.md -[product-docs]: https://cloud.google.com/tasks/docs/ diff --git a/samples/generated/v2/cloud_tasks.create_queue.js b/samples/generated/v2/cloud_tasks.create_queue.js deleted file mode 100644 index 19a1ce16..00000000 --- a/samples/generated/v2/cloud_tasks.create_queue.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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, queue) { - // [START cloudtasks_v2_generated_CloudTasks_CreateQueue_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 location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * ListLocations google.cloud.location.Locations.ListLocations. - */ - // const parent = 'abc123' - /** - * Required. The queue to create. - * Queue's name google.cloud.tasks.v2.Queue.name cannot be the same as an existing queue. - */ - // const queue = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCreateQueue() { - // Construct request - const request = { - parent, - queue, - }; - - // Run request - const response = await tasksClient.createQueue(request); - console.log(response); - } - - callCreateQueue(); - // [END cloudtasks_v2_generated_CloudTasks_CreateQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.create_task.js b/samples/generated/v2/cloud_tasks.create_task.js deleted file mode 100644 index f12a46c9..00000000 --- a/samples/generated/v2/cloud_tasks.create_task.js +++ /dev/null @@ -1,108 +0,0 @@ -// 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, task) { - // [START cloudtasks_v2_generated_CloudTasks_CreateTask_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - */ - // const parent = 'abc123' - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task name google.cloud.tasks.v2.Task.name. If a - * name is not specified then the system will generate a random - * unique task id, which will be set in the task returned in the - * response google.cloud.tasks.v2.Task.name. - * If schedule_time google.cloud.tasks.v2.Task.schedule_time is not set or is in the - * past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with ALREADY_EXISTS google.rpc.Code.ALREADY_EXISTS. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these CreateTask google.cloud.tasks.v2.CloudTasks.CreateTask calls have significantly - * increased latency. Using hashed strings for the task id or for - * the prefix of the task id is recommended. Choosing task ids that - * are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - */ - // const task = {} - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCreateTask() { - // Construct request - const request = { - parent, - task, - }; - - // Run request - const response = await tasksClient.createTask(request); - console.log(response); - } - - callCreateTask(); - // [END cloudtasks_v2_generated_CloudTasks_CreateTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.delete_queue.js b/samples/generated/v2/cloud_tasks.delete_queue.js deleted file mode 100644 index 85bfa189..00000000 --- a/samples/generated/v2/cloud_tasks.delete_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_DeleteQueue_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callDeleteQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.deleteQueue(request); - console.log(response); - } - - callDeleteQueue(); - // [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.delete_task.js b/samples/generated/v2/cloud_tasks.delete_task.js deleted file mode 100644 index a1ba2911..00000000 --- a/samples/generated/v2/cloud_tasks.delete_task.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_DeleteTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callDeleteTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.deleteTask(request); - console.log(response); - } - - callDeleteTask(); - // [END cloudtasks_v2_generated_CloudTasks_DeleteTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.get_iam_policy.js b/samples/generated/v2/cloud_tasks.get_iam_policy.js deleted file mode 100644 index bd51b3e6..00000000 --- a/samples/generated/v2/cloud_tasks.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// 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(resource) { - // [START cloudtasks_v2_generated_CloudTasks_GetIamPolicy_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 for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await tasksClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.get_queue.js b/samples/generated/v2/cloud_tasks.get_queue.js deleted file mode 100644 index 3fd4093f..00000000 --- a/samples/generated/v2/cloud_tasks.get_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_GetQueue_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 queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.getQueue(request); - console.log(response); - } - - callGetQueue(); - // [END cloudtasks_v2_generated_CloudTasks_GetQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.get_task.js b/samples/generated/v2/cloud_tasks.get_task.js deleted file mode 100644 index 74363e30..00000000 --- a/samples/generated/v2/cloud_tasks.get_task.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_GetTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END cloudtasks_v2_generated_CloudTasks_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.list_queues.js b/samples/generated/v2/cloud_tasks.list_queues.js deleted file mode 100644 index 9ff20480..00000000 --- a/samples/generated/v2/cloud_tasks.list_queues.js +++ /dev/null @@ -1,95 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_ListQueues_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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - */ - // const parent = 'abc123' - /** - * `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2.Queue - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * Stackdriver's Advanced Logs - * Filters (https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - */ - // const filter = 'abc123' - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token in the - * response to determine if more queues exist. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * next_page_token google.cloud.tasks.v2.ListQueuesResponse.next_page_token returned - * from the previous call to ListQueues google.cloud.tasks.v2.CloudTasks.ListQueues - * method. It is an error to switch the value of the - * filter google.cloud.tasks.v2.ListQueuesRequest.filter while iterating through pages. - */ - // const pageToken = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callListQueues() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await tasksClient.listQueuesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListQueues(); - // [END cloudtasks_v2_generated_CloudTasks_ListQueues_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.list_tasks.js b/samples/generated/v2/cloud_tasks.list_tasks.js deleted file mode 100644 index 83570dd9..00000000 --- a/samples/generated/v2/cloud_tasks.list_tasks.js +++ /dev/null @@ -1,96 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_ListTasks_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const parent = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2.Task resource. - */ - // const responseView = {} - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token in the response to - * determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * next_page_token google.cloud.tasks.v2.ListTasksResponse.next_page_token returned - * from the previous call to ListTasks google.cloud.tasks.v2.CloudTasks.ListTasks - * method. - * The page token is valid for only 2 hours. - */ - // const pageToken = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await tasksClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END cloudtasks_v2_generated_CloudTasks_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.pause_queue.js b/samples/generated/v2/cloud_tasks.pause_queue.js deleted file mode 100644 index 5c394a38..00000000 --- a/samples/generated/v2/cloud_tasks.pause_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_PauseQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callPauseQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.pauseQueue(request); - console.log(response); - } - - callPauseQueue(); - // [END cloudtasks_v2_generated_CloudTasks_PauseQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.purge_queue.js b/samples/generated/v2/cloud_tasks.purge_queue.js deleted file mode 100644 index a3b5d17b..00000000 --- a/samples/generated/v2/cloud_tasks.purge_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_PurgeQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callPurgeQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.purgeQueue(request); - console.log(response); - } - - callPurgeQueue(); - // [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.resume_queue.js b/samples/generated/v2/cloud_tasks.resume_queue.js deleted file mode 100644 index 66a22338..00000000 --- a/samples/generated/v2/cloud_tasks.resume_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_ResumeQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callResumeQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.resumeQueue(request); - console.log(response); - } - - callResumeQueue(); - // [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.run_task.js b/samples/generated/v2/cloud_tasks.run_task.js deleted file mode 100644 index 7a073845..00000000 --- a/samples/generated/v2/cloud_tasks.run_task.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 cloudtasks_v2_generated_CloudTasks_RunTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callRunTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.runTask(request); - console.log(response); - } - - callRunTask(); - // [END cloudtasks_v2_generated_CloudTasks_RunTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.set_iam_policy.js b/samples/generated/v2/cloud_tasks.set_iam_policy.js deleted file mode 100644 index 77847e91..00000000 --- a/samples/generated/v2/cloud_tasks.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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(resource, policy) { - // [START cloudtasks_v2_generated_CloudTasks_SetIamPolicy_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 for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await tasksClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.test_iam_permissions.js b/samples/generated/v2/cloud_tasks.test_iam_permissions.js deleted file mode 100644 index 5ade98a7..00000000 --- a/samples/generated/v2/cloud_tasks.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// 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(resource, permissions) { - // [START cloudtasks_v2_generated_CloudTasks_TestIamPermissions_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 for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await tasksClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/cloud_tasks.update_queue.js b/samples/generated/v2/cloud_tasks.update_queue.js deleted file mode 100644 index 11a703a0..00000000 --- a/samples/generated/v2/cloud_tasks.update_queue.js +++ /dev/null @@ -1,70 +0,0 @@ -// 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(queue) { - // [START cloudtasks_v2_generated_CloudTasks_UpdateQueue_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 queue to create or update. - * The queue's name google.cloud.tasks.v2.Queue.name must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's name google.cloud.tasks.v2.Queue.name cannot be changed. - */ - // const queue = {} - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - */ - // const updateMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callUpdateQueue() { - // Construct request - const request = { - queue, - }; - - // Run request - const response = await tasksClient.updateQueue(request); - console.log(response); - } - - callUpdateQueue(); - // [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2/snippet_metadata.google.cloud.tasks.v2.json b/samples/generated/v2/snippet_metadata.google.cloud.tasks.v2.json deleted file mode 100644 index 1c166395..00000000 --- a/samples/generated/v2/snippet_metadata.google.cloud.tasks.v2.json +++ /dev/null @@ -1,719 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-tasks", - "version": "3.0.5", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.tasks.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_ListQueues_async", - "title": "tasks listQueues Sample", - "origin": "API_DEFINITION", - "description": " Lists queues. Queues are returned in lexicographical order.", - "canonical": true, - "file": "cloud_tasks.list_queues.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListQueues", - "fullName": "google.cloud.tasks.v2.CloudTasks.ListQueues", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2.ListQueuesResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "ListQueues", - "fullName": "google.cloud.tasks.v2.CloudTasks.ListQueues", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_GetQueue_async", - "title": "tasks getQueue Sample", - "origin": "API_DEFINITION", - "description": " Gets a queue.", - "canonical": true, - "file": "cloud_tasks.get_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.GetQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "GetQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.GetQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_CreateQueue_async", - "title": "tasks createQueue Sample", - "origin": "API_DEFINITION", - "description": " Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.create_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.CreateQueue", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "queue", - "type": ".google.cloud.tasks.v2.Queue" - } - ], - "resultType": ".google.cloud.tasks.v2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "CreateQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.CreateQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_UpdateQueue_async", - "title": "tasks updateQueue Sample", - "origin": "API_DEFINITION", - "description": " Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.update_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.UpdateQueue", - "async": true, - "parameters": [ - { - "name": "queue", - "type": ".google.cloud.tasks.v2.Queue" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "UpdateQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.UpdateQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_DeleteQueue_async", - "title": "tasks deleteQueue Sample", - "origin": "API_DEFINITION", - "description": " Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.delete_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "DeleteQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_PurgeQueue_async", - "title": "tasks purgeQueue Sample", - "origin": "API_DEFINITION", - "description": " Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.", - "canonical": true, - "file": "cloud_tasks.purge_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PurgeQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.PurgeQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "PurgeQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.PurgeQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_PauseQueue_async", - "title": "tasks pauseQueue Sample", - "origin": "API_DEFINITION", - "description": " Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED].", - "canonical": true, - "file": "cloud_tasks.pause_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PauseQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.PauseQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "PauseQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.PauseQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_ResumeQueue_async", - "title": "tasks resumeQueue Sample", - "origin": "API_DEFINITION", - "description": " Resume a queue. This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2.Queue.State.RUNNING]. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).", - "canonical": true, - "file": "cloud_tasks.resume_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResumeQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.ResumeQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "ResumeQueue", - "fullName": "google.cloud.tasks.v2.CloudTasks.ResumeQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async", - "title": "tasks getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy`", - "canonical": true, - "file": "cloud_tasks.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.tasks.v2.CloudTasks.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.tasks.v2.CloudTasks.GetIamPolicy", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async", - "title": "tasks setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy`", - "canonical": true, - "file": "cloud_tasks.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.tasks.v2.CloudTasks.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.tasks.v2.CloudTasks.SetIamPolicy", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async", - "title": "tasks testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", - "canonical": true, - "file": "cloud_tasks.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.tasks.v2.CloudTasks.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.tasks.v2.CloudTasks.TestIamPermissions", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_ListTasks_async", - "title": "tasks listTasks Sample", - "origin": "API_DEFINITION", - "description": " Lists the tasks in a queue. By default, only the [BASIC][google.cloud.tasks.v2.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2.ListTasksRequest.response_view] controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time.", - "canonical": true, - "file": "cloud_tasks.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2.Task.View" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2.ListTasksResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks.ListTasks", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_GetTask_async", - "title": "tasks getTask Sample", - "origin": "API_DEFINITION", - "description": " Gets a task.", - "canonical": true, - "file": "cloud_tasks.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.GetTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_CreateTask_async", - "title": "tasks createTask Sample", - "origin": "API_DEFINITION", - "description": " Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB.", - "canonical": true, - "file": "cloud_tasks.create_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 100, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.CreateTask", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "task", - "type": ".google.cloud.tasks.v2.Task" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "CreateTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.CreateTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_DeleteTask_async", - "title": "tasks deleteTask Sample", - "origin": "API_DEFINITION", - "description": " Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.", - "canonical": true, - "file": "cloud_tasks.delete_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "DeleteTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2_generated_CloudTasks_RunTask_async", - "title": "tasks runTask Sample", - "origin": "API_DEFINITION", - "description": " Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2.RateLimits] or is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2.RetryConfig]. [RunTask][google.cloud.tasks.v2.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.", - "canonical": true, - "file": "cloud_tasks.run_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.RunTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2.CloudTasksClient" - }, - "method": { - "shortName": "RunTask", - "fullName": "google.cloud.tasks.v2.CloudTasks.RunTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2.CloudTasks" - } - } - } - } - ] -} \ No newline at end of file diff --git a/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js b/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js deleted file mode 100644 index 44439ef1..00000000 --- a/samples/generated/v2beta2/cloud_tasks.acknowledge_task.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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, scheduleTime) { - // [START cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * Required. The task's current schedule time, available in the - * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time returned by - * LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks response or - * RenewLease google.cloud.tasks.v2beta2.CloudTasks.RenewLease response. This restriction is - * to ensure that your worker currently holds the lease. - */ - // const scheduleTime = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callAcknowledgeTask() { - // Construct request - const request = { - name, - scheduleTime, - }; - - // Run request - const response = await tasksClient.acknowledgeTask(request); - console.log(response); - } - - callAcknowledgeTask(); - // [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.cancel_lease.js b/samples/generated/v2beta2/cloud_tasks.cancel_lease.js deleted file mode 100644 index af50cf25..00000000 --- a/samples/generated/v2beta2/cloud_tasks.cancel_lease.js +++ /dev/null @@ -1,84 +0,0 @@ -// 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, scheduleTime) { - // [START cloudtasks_v2beta2_generated_CloudTasks_CancelLease_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * Required. The task's current schedule time, available in the - * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time returned by - * LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks response or - * RenewLease google.cloud.tasks.v2beta2.CloudTasks.RenewLease response. This restriction is - * to ensure that your worker currently holds the lease. - */ - // const scheduleTime = {} - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCancelLease() { - // Construct request - const request = { - name, - scheduleTime, - }; - - // Run request - const response = await tasksClient.cancelLease(request); - console.log(response); - } - - callCancelLease(); - // [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.create_queue.js b/samples/generated/v2beta2/cloud_tasks.create_queue.js deleted file mode 100644 index 0631c28b..00000000 --- a/samples/generated/v2beta2/cloud_tasks.create_queue.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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, queue) { - // [START cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_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 location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * ListLocations google.cloud.location.Locations.ListLocations. - */ - // const parent = 'abc123' - /** - * Required. The queue to create. - * Queue's name google.cloud.tasks.v2beta2.Queue.name cannot be the same as an existing queue. - */ - // const queue = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCreateQueue() { - // Construct request - const request = { - parent, - queue, - }; - - // Run request - const response = await tasksClient.createQueue(request); - console.log(response); - } - - callCreateQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.create_task.js b/samples/generated/v2beta2/cloud_tasks.create_task.js deleted file mode 100644 index 7cdaad64..00000000 --- a/samples/generated/v2beta2/cloud_tasks.create_task.js +++ /dev/null @@ -1,108 +0,0 @@ -// 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, task) { - // [START cloudtasks_v2beta2_generated_CloudTasks_CreateTask_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - */ - // const parent = 'abc123' - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task name google.cloud.tasks.v2beta2.Task.name. If a - * name is not specified then the system will generate a random - * unique task id, which will be set in the task returned in the - * response google.cloud.tasks.v2beta2.Task.name. - * If schedule_time google.cloud.tasks.v2beta2.Task.schedule_time is not set or is in the - * past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with ALREADY_EXISTS google.rpc.Code.ALREADY_EXISTS. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or completed. - * Because there is an extra lookup cost to identify duplicate task - * names, these CreateTask google.cloud.tasks.v2beta2.CloudTasks.CreateTask calls have significantly - * increased latency. Using hashed strings for the task id or for - * the prefix of the task id is recommended. Choosing task ids that - * are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - */ - // const task = {} - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCreateTask() { - // Construct request - const request = { - parent, - task, - }; - - // Run request - const response = await tasksClient.createTask(request); - console.log(response); - } - - callCreateTask(); - // [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.delete_queue.js b/samples/generated/v2beta2/cloud_tasks.delete_queue.js deleted file mode 100644 index 1e0e84fb..00000000 --- a/samples/generated/v2beta2/cloud_tasks.delete_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callDeleteQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.deleteQueue(request); - console.log(response); - } - - callDeleteQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.delete_task.js b/samples/generated/v2beta2/cloud_tasks.delete_task.js deleted file mode 100644 index 3745a1ee..00000000 --- a/samples/generated/v2beta2/cloud_tasks.delete_task.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callDeleteTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.deleteTask(request); - console.log(response); - } - - callDeleteTask(); - // [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js b/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js deleted file mode 100644 index 0d957f55..00000000 --- a/samples/generated/v2beta2/cloud_tasks.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// 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(resource) { - // [START cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_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 for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await tasksClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.get_queue.js b/samples/generated/v2beta2/cloud_tasks.get_queue.js deleted file mode 100644 index a5eafd39..00000000 --- a/samples/generated/v2beta2/cloud_tasks.get_queue.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_GetQueue_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 queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - /** - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * Queue.stats. Queue.stats will be returned only if it was explicitly - * specified in the mask. - */ - // const readMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.getQueue(request); - console.log(response); - } - - callGetQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.get_task.js b/samples/generated/v2beta2/cloud_tasks.get_task.js deleted file mode 100644 index 774f7a39..00000000 --- a/samples/generated/v2beta2/cloud_tasks.get_task.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_GetTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.lease_tasks.js b/samples/generated/v2beta2/cloud_tasks.lease_tasks.js deleted file mode 100644 index 8a106809..00000000 --- a/samples/generated/v2beta2/cloud_tasks.lease_tasks.js +++ /dev/null @@ -1,128 +0,0 @@ -// 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, leaseDuration) { - // [START cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const parent = 'abc123' - /** - * The maximum number of tasks to lease. - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * The largest that `max_tasks` can be is 1000. - * The maximum total size of a lease tasks response google.cloud.tasks.v2beta2.LeaseTasksResponse is - * 32 MB. If the sum of all task sizes requested reaches this limit, - * fewer tasks than requested are returned. - */ - // const maxTasks = 1234 - /** - * Required. The duration of the lease. - * Each task returned in the response google.cloud.tasks.v2beta2.LeaseTasksResponse will - * have its schedule_time google.cloud.tasks.v2beta2.Task.schedule_time set to the current - * time plus the `lease_duration`. The task is leased until its - * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time; thus, the task will not be - * returned to another LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks call - * before its schedule_time google.cloud.tasks.v2beta2.Task.schedule_time. - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * AcknowledgeTask google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask before the - * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time. Otherwise the task will be - * returned to a later LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks call so - * that another worker can retry it. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - */ - // const leaseDuration = {} - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - /** - * `filter` can be used to specify a subset of tasks to lease. - * When `filter` is set to `tag=` then the - * response google.cloud.tasks.v2beta2.LeaseTasksResponse will contain only tasks whose - * tag google.cloud.tasks.v2beta2.PullMessage.tag is equal to ``. `` must be - * less than 500 characters. - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time will be returned. - * Grammar Syntax: - * * `filter = "tag=" tag | "tag_function=" function` - * * `tag = string` - * * `function = "oldest_tag()"` - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * SDK compatibility: Although the SDK allows tags to be either - * string or - * bytes (https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * filter google.cloud.tasks.v2beta2.LeaseTasksRequest.filter and the task's - * tag google.cloud.tasks.v2beta2.PullMessage.tag will be displayed as empty in Cloud Tasks. - */ - // const filter = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callLeaseTasks() { - // Construct request - const request = { - parent, - leaseDuration, - }; - - // Run request - const response = await tasksClient.leaseTasks(request); - console.log(response); - } - - callLeaseTasks(); - // [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.list_queues.js b/samples/generated/v2beta2/cloud_tasks.list_queues.js deleted file mode 100644 index 03f7947f..00000000 --- a/samples/generated/v2beta2/cloud_tasks.list_queues.js +++ /dev/null @@ -1,102 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_ListQueues_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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - */ - // const parent = 'abc123' - /** - * `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2beta2.Queue - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * Stackdriver's Advanced Logs - * Filters (https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "app_engine_http_target: *". - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - */ - // const filter = 'abc123' - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * next_page_token google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token in the - * response to determine if more queues exist. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * next_page_token google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token returned - * from the previous call to ListQueues google.cloud.tasks.v2beta2.CloudTasks.ListQueues - * method. It is an error to switch the value of the - * filter google.cloud.tasks.v2beta2.ListQueuesRequest.filter while iterating through pages. - */ - // const pageToken = 'abc123' - /** - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * Queue.stats. Queue.stats will be returned only if it was explicitly - * specified in the mask. - */ - // const readMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callListQueues() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await tasksClient.listQueuesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListQueues(); - // [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.list_tasks.js b/samples/generated/v2beta2/cloud_tasks.list_tasks.js deleted file mode 100644 index bc64cffe..00000000 --- a/samples/generated/v2beta2/cloud_tasks.list_tasks.js +++ /dev/null @@ -1,96 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_ListTasks_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const parent = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * next_page_token google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token in the response to - * determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * next_page_token google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token returned - * from the previous call to ListTasks google.cloud.tasks.v2beta2.CloudTasks.ListTasks - * method. - * The page token is valid for only 2 hours. - */ - // const pageToken = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await tasksClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.pause_queue.js b/samples/generated/v2beta2/cloud_tasks.pause_queue.js deleted file mode 100644 index bbad890a..00000000 --- a/samples/generated/v2beta2/cloud_tasks.pause_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callPauseQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.pauseQueue(request); - console.log(response); - } - - callPauseQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.purge_queue.js b/samples/generated/v2beta2/cloud_tasks.purge_queue.js deleted file mode 100644 index baa7e7ee..00000000 --- a/samples/generated/v2beta2/cloud_tasks.purge_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callPurgeQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.purgeQueue(request); - console.log(response); - } - - callPurgeQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.renew_lease.js b/samples/generated/v2beta2/cloud_tasks.renew_lease.js deleted file mode 100644 index 9c56ee4e..00000000 --- a/samples/generated/v2beta2/cloud_tasks.renew_lease.js +++ /dev/null @@ -1,91 +0,0 @@ -// 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, scheduleTime, leaseDuration) { - // [START cloudtasks_v2beta2_generated_CloudTasks_RenewLease_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * Required. The task's current schedule time, available in the - * schedule_time google.cloud.tasks.v2beta2.Task.schedule_time returned by - * LeaseTasks google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks response or - * RenewLease google.cloud.tasks.v2beta2.CloudTasks.RenewLease response. This restriction is - * to ensure that your worker currently holds the lease. - */ - // const scheduleTime = {} - /** - * Required. The desired new lease duration, starting from now. - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - */ - // const leaseDuration = {} - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callRenewLease() { - // Construct request - const request = { - name, - scheduleTime, - leaseDuration, - }; - - // Run request - const response = await tasksClient.renewLease(request); - console.log(response); - } - - callRenewLease(); - // [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.resume_queue.js b/samples/generated/v2beta2/cloud_tasks.resume_queue.js deleted file mode 100644 index 6849fe49..00000000 --- a/samples/generated/v2beta2/cloud_tasks.resume_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callResumeQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.resumeQueue(request); - console.log(response); - } - - callResumeQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.run_task.js b/samples/generated/v2beta2/cloud_tasks.run_task.js deleted file mode 100644 index b3745338..00000000 --- a/samples/generated/v2beta2/cloud_tasks.run_task.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 cloudtasks_v2beta2_generated_CloudTasks_RunTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta2.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta2.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta2.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta2.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callRunTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.runTask(request); - console.log(response); - } - - callRunTask(); - // [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js b/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js deleted file mode 100644 index f7852bcb..00000000 --- a/samples/generated/v2beta2/cloud_tasks.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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(resource, policy) { - // [START cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_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 for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await tasksClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js b/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js deleted file mode 100644 index af39688a..00000000 --- a/samples/generated/v2beta2/cloud_tasks.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// 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(resource, permissions) { - // [START cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_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 for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await tasksClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/cloud_tasks.update_queue.js b/samples/generated/v2beta2/cloud_tasks.update_queue.js deleted file mode 100644 index f8d14ea8..00000000 --- a/samples/generated/v2beta2/cloud_tasks.update_queue.js +++ /dev/null @@ -1,70 +0,0 @@ -// 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(queue) { - // [START cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_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 queue to create or update. - * The queue's name google.cloud.tasks.v2beta2.Queue.name must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's name google.cloud.tasks.v2beta2.Queue.name cannot be changed. - */ - // const queue = {} - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - */ - // const updateMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta2; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callUpdateQueue() { - // Construct request - const request = { - queue, - }; - - // Run request - const response = await tasksClient.updateQueue(request); - console.log(response); - } - - callUpdateQueue(); - // [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta2/snippet_metadata.google.cloud.tasks.v2beta2.json b/samples/generated/v2beta2/snippet_metadata.google.cloud.tasks.v2beta2.json deleted file mode 100644 index 6f814778..00000000 --- a/samples/generated/v2beta2/snippet_metadata.google.cloud.tasks.v2beta2.json +++ /dev/null @@ -1,927 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-tasks", - "version": "3.0.5", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.tasks.v2beta2", - "version": "v2beta2" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ListQueues_async", - "title": "tasks listQueues Sample", - "origin": "API_DEFINITION", - "description": " Lists queues. Queues are returned in lexicographical order.", - "canonical": true, - "file": "cloud_tasks.list_queues.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListQueues", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListQueues", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.ListQueuesResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "ListQueues", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListQueues", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetQueue_async", - "title": "tasks getQueue Sample", - "origin": "API_DEFINITION", - "description": " Gets a queue.", - "canonical": true, - "file": "cloud_tasks.get_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "GetQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_async", - "title": "tasks createQueue Sample", - "origin": "API_DEFINITION", - "description": " Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.create_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateQueue", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "queue", - "type": ".google.cloud.tasks.v2beta2.Queue" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "CreateQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_async", - "title": "tasks updateQueue Sample", - "origin": "API_DEFINITION", - "description": " Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.update_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue", - "async": true, - "parameters": [ - { - "name": "queue", - "type": ".google.cloud.tasks.v2beta2.Queue" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "UpdateQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_async", - "title": "tasks deleteQueue Sample", - "origin": "API_DEFINITION", - "description": " Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.delete_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "DeleteQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_async", - "title": "tasks purgeQueue Sample", - "origin": "API_DEFINITION", - "description": " Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.", - "canonical": true, - "file": "cloud_tasks.purge_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PurgeQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "PurgeQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_async", - "title": "tasks pauseQueue Sample", - "origin": "API_DEFINITION", - "description": " Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta2.Queue.state] is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED].", - "canonical": true, - "file": "cloud_tasks.pause_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PauseQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PauseQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "PauseQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PauseQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_async", - "title": "tasks resumeQueue Sample", - "origin": "API_DEFINITION", - "description": " Resume a queue. This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta2.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta2.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta2.Queue.State.RUNNING]. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).", - "canonical": true, - "file": "cloud_tasks.resume_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResumeQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "ResumeQueue", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async", - "title": "tasks getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy for a [Queue][google.cloud.tasks.v2beta2.Queue]. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy`", - "canonical": true, - "file": "cloud_tasks.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicy", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async", - "title": "tasks setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy for a [Queue][google.cloud.tasks.v2beta2.Queue]. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy`", - "canonical": true, - "file": "cloud_tasks.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicy", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async", - "title": "tasks testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta2.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", - "canonical": true, - "file": "cloud_tasks.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissions", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ListTasks_async", - "title": "tasks listTasks Sample", - "origin": "API_DEFINITION", - "description": " Lists the tasks in a queue. By default, only the [BASIC][google.cloud.tasks.v2beta2.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta2.ListTasksRequest.response_view] controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time.", - "canonical": true, - "file": "cloud_tasks.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.ListTasksResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListTasks", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetTask_async", - "title": "tasks getTask Sample", - "origin": "API_DEFINITION", - "description": " Gets a task.", - "canonical": true, - "file": "cloud_tasks.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CreateTask_async", - "title": "tasks createTask Sample", - "origin": "API_DEFINITION", - "description": " Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * For [App Engine queues][google.cloud.tasks.v2beta2.AppEngineHttpTarget], the maximum task size is 100KB. * For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum task size is 1MB.", - "canonical": true, - "file": "cloud_tasks.create_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 100, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateTask", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "task", - "type": ".google.cloud.tasks.v2beta2.Task" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "CreateTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_async", - "title": "tasks deleteTask Sample", - "origin": "API_DEFINITION", - "description": " Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has completed successfully or permanently failed.", - "canonical": true, - "file": "cloud_tasks.delete_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "DeleteTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_async", - "title": "tasks leaseTasks Sample", - "origin": "API_DEFINITION", - "description": " Leases tasks from a pull queue for [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration]. This method is invoked by the worker to obtain a lease. The worker must acknowledge the task via [AcknowledgeTask][google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask] after they have performed the work associated with the task. The [payload][google.cloud.tasks.v2beta2.PullMessage.payload] is intended to store data that the worker needs to perform the work associated with the task. To return the payloads in the [response][google.cloud.tasks.v2beta2.LeaseTasksResponse], set [response_view][google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view] to [FULL][google.cloud.tasks.v2beta2.Task.View.FULL]. A maximum of 10 qps of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] requests are allowed per queue. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] is returned when this limit is exceeded. [RESOURCE_EXHAUSTED][google.rpc.Code.RESOURCE_EXHAUSTED] is also returned when [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] is exceeded.", - "canonical": true, - "file": "cloud_tasks.lease_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 120, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "LeaseTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "max_tasks", - "type": "TYPE_INT32" - }, - { - "name": "lease_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.LeaseTasksResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "LeaseTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_async", - "title": "tasks acknowledgeTask Sample", - "origin": "API_DEFINITION", - "description": " Acknowledges a pull task. The worker, that is, the entity that [leased][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] this task must call this method to indicate that the work associated with the task has finished. The worker must acknowledge a task within the [lease_duration][google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration] or the lease will expire and the task will become available to be leased again. After the task is acknowledged, it will not be returned by a later [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks], [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks].", - "canonical": true, - "file": "cloud_tasks.acknowledge_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AcknowledgeTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "schedule_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "AcknowledgeTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_RenewLease_async", - "title": "tasks renewLease Sample", - "origin": "API_DEFINITION", - "description": " Renew the current lease of a pull task. The worker can use this method to extend the lease by a new duration, starting from now. The new task lease will be returned in the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time].", - "canonical": true, - "file": "cloud_tasks.renew_lease.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RenewLease", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RenewLease", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "schedule_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "lease_duration", - "type": ".google.protobuf.Duration" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "RenewLease", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RenewLease", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CancelLease_async", - "title": "tasks cancelLease Sample", - "origin": "API_DEFINITION", - "description": " Cancel a pull task's lease. The worker can use this method to cancel a task's lease by setting its [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] to now. This will make the task available to be leased to the next caller of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks].", - "canonical": true, - "file": "cloud_tasks.cancel_lease.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelLease", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CancelLease", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "schedule_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "CancelLease", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CancelLease", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_RunTask_async", - "title": "tasks runTask Sample", - "origin": "API_DEFINITION", - "description": " Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta2.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the [status][google.cloud.tasks.v2beta2.Task.status] after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta2.RetryConfig]. [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed. [RunTask][google.cloud.tasks.v2beta2.CloudTasks.RunTask] cannot be called on a [pull task][google.cloud.tasks.v2beta2.PullMessage].", - "canonical": true, - "file": "cloud_tasks.run_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RunTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta2.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta2.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta2.CloudTasksClient" - }, - "method": { - "shortName": "RunTask", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RunTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta2.CloudTasks" - } - } - } - } - ] -} \ No newline at end of file diff --git a/samples/generated/v2beta3/cloud_tasks.create_queue.js b/samples/generated/v2beta3/cloud_tasks.create_queue.js deleted file mode 100644 index 5137c0e3..00000000 --- a/samples/generated/v2beta3/cloud_tasks.create_queue.js +++ /dev/null @@ -1,71 +0,0 @@ -// 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, queue) { - // [START cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_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 location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * ListLocations google.cloud.location.Locations.ListLocations. - */ - // const parent = 'abc123' - /** - * Required. The queue to create. - * Queue's name google.cloud.tasks.v2beta3.Queue.name cannot be the same as an existing queue. - */ - // const queue = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCreateQueue() { - // Construct request - const request = { - parent, - queue, - }; - - // Run request - const response = await tasksClient.createQueue(request); - console.log(response); - } - - callCreateQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.create_task.js b/samples/generated/v2beta3/cloud_tasks.create_task.js deleted file mode 100644 index 67724217..00000000 --- a/samples/generated/v2beta3/cloud_tasks.create_task.js +++ /dev/null @@ -1,108 +0,0 @@ -// 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, task) { - // [START cloudtasks_v2beta3_generated_CloudTasks_CreateTask_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * The queue must already exist. - */ - // const parent = 'abc123' - /** - * Required. The task to add. - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task name google.cloud.tasks.v2beta3.Task.name. If a - * name is not specified then the system will generate a random - * unique task id, which will be set in the task returned in the - * response google.cloud.tasks.v2beta3.Task.name. - * If schedule_time google.cloud.tasks.v2beta3.Task.schedule_time is not set or is in the - * past then Cloud Tasks will set it to the current time. - * Task De-duplication: - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with ALREADY_EXISTS google.rpc.Code.ALREADY_EXISTS. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * Because there is an extra lookup cost to identify duplicate task - * names, these CreateTask google.cloud.tasks.v2beta3.CloudTasks.CreateTask calls have significantly - * increased latency. Using hashed strings for the task id or for - * the prefix of the task id is recommended. Choosing task ids that - * are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - */ - // const task = {} - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta3.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callCreateTask() { - // Construct request - const request = { - parent, - task, - }; - - // Run request - const response = await tasksClient.createTask(request); - console.log(response); - } - - callCreateTask(); - // [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.delete_queue.js b/samples/generated/v2beta3/cloud_tasks.delete_queue.js deleted file mode 100644 index 21e794bb..00000000 --- a/samples/generated/v2beta3/cloud_tasks.delete_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callDeleteQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.deleteQueue(request); - console.log(response); - } - - callDeleteQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.delete_task.js b/samples/generated/v2beta3/cloud_tasks.delete_task.js deleted file mode 100644 index ecab78e9..00000000 --- a/samples/generated/v2beta3/cloud_tasks.delete_task.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callDeleteTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.deleteTask(request); - console.log(response); - } - - callDeleteTask(); - // [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js b/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js deleted file mode 100644 index b685d7e7..00000000 --- a/samples/generated/v2beta3/cloud_tasks.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// 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(resource) { - // [START cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_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 for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await tasksClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.get_queue.js b/samples/generated/v2beta3/cloud_tasks.get_queue.js deleted file mode 100644 index 1ce1b141..00000000 --- a/samples/generated/v2beta3/cloud_tasks.get_queue.js +++ /dev/null @@ -1,69 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_GetQueue_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 queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - /** - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * Queue.stats. Queue.stats will be returned only if it was explicitly - * specified in the mask. - */ - // const readMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.getQueue(request); - console.log(response); - } - - callGetQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.get_task.js b/samples/generated/v2beta3/cloud_tasks.get_task.js deleted file mode 100644 index c92a1bbb..00000000 --- a/samples/generated/v2beta3/cloud_tasks.get_task.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_GetTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta3.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callGetTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.getTask(request); - console.log(response); - } - - callGetTask(); - // [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.list_queues.js b/samples/generated/v2beta3/cloud_tasks.list_queues.js deleted file mode 100644 index f10b6f6b..00000000 --- a/samples/generated/v2beta3/cloud_tasks.list_queues.js +++ /dev/null @@ -1,102 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_ListQueues_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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - */ - // const parent = 'abc123' - /** - * `filter` can be used to specify a subset of queues. Any Queue google.cloud.tasks.v2beta3.Queue - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * Stackdriver's Advanced Logs - * Filters (https://cloud.google.com/logging/docs/view/advanced_filters). - * Sample filter "state: PAUSED". - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - */ - // const filter = 'abc123' - /** - * Requested page size. - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * next_page_token google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token in the - * response to determine if more queues exist. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * next_page_token google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token returned - * from the previous call to ListQueues google.cloud.tasks.v2beta3.CloudTasks.ListQueues - * method. It is an error to switch the value of the - * filter google.cloud.tasks.v2beta3.ListQueuesRequest.filter while iterating through pages. - */ - // const pageToken = 'abc123' - /** - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * Queue.stats. Queue.stats will be returned only if it was explicitly - * specified in the mask. - */ - // const readMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callListQueues() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await tasksClient.listQueuesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListQueues(); - // [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.list_tasks.js b/samples/generated/v2beta3/cloud_tasks.list_tasks.js deleted file mode 100644 index 3b861402..00000000 --- a/samples/generated/v2beta3/cloud_tasks.list_tasks.js +++ /dev/null @@ -1,96 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_ListTasks_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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - */ - // const parent = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta3.Task resource. - */ - // const responseView = {} - /** - * Maximum page size. - * Fewer tasks than requested might be returned, even if more tasks exist; use - * next_page_token google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token in the response to - * determine if more tasks exist. - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - */ - // const pageSize = 1234 - /** - * A token identifying the page of results to return. - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * next_page_token google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token returned - * from the previous call to ListTasks google.cloud.tasks.v2beta3.CloudTasks.ListTasks - * method. - * The page token is valid for only 2 hours. - */ - // const pageToken = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callListTasks() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await tasksClient.listTasksAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTasks(); - // [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.pause_queue.js b/samples/generated/v2beta3/cloud_tasks.pause_queue.js deleted file mode 100644 index 56558ec5..00000000 --- a/samples/generated/v2beta3/cloud_tasks.pause_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callPauseQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.pauseQueue(request); - console.log(response); - } - - callPauseQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.purge_queue.js b/samples/generated/v2beta3/cloud_tasks.purge_queue.js deleted file mode 100644 index 72adceed..00000000 --- a/samples/generated/v2beta3/cloud_tasks.purge_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callPurgeQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.purgeQueue(request); - console.log(response); - } - - callPurgeQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.resume_queue.js b/samples/generated/v2beta3/cloud_tasks.resume_queue.js deleted file mode 100644 index 8b641856..00000000 --- a/samples/generated/v2beta3/cloud_tasks.resume_queue.js +++ /dev/null @@ -1,62 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_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 queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - */ - // const name = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callResumeQueue() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.resumeQueue(request); - console.log(response); - } - - callResumeQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.run_task.js b/samples/generated/v2beta3/cloud_tasks.run_task.js deleted file mode 100644 index 423c0ac6..00000000 --- a/samples/generated/v2beta3/cloud_tasks.run_task.js +++ /dev/null @@ -1,75 +0,0 @@ -// 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 cloudtasks_v2beta3_generated_CloudTasks_RunTask_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 task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - */ - // const name = 'abc123' - /** - * The response_view specifies which subset of the Task google.cloud.tasks.v2beta3.Task will be - * returned. - * By default response_view is BASIC google.cloud.tasks.v2beta3.Task.View.BASIC; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * Authorization for FULL google.cloud.tasks.v2beta3.Task.View.FULL requires - * `cloudtasks.tasks.fullView` Google IAM (https://cloud.google.com/iam/) - * permission on the Task google.cloud.tasks.v2beta3.Task resource. - */ - // const responseView = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callRunTask() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await tasksClient.runTask(request); - console.log(response); - } - - callRunTask(); - // [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js b/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js deleted file mode 100644 index 420e69f1..00000000 --- a/samples/generated/v2beta3/cloud_tasks.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// 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(resource, policy) { - // [START cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_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 for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await tasksClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js b/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js deleted file mode 100644 index e583d983..00000000 --- a/samples/generated/v2beta3/cloud_tasks.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// 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(resource, permissions) { - // [START cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_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 for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = 'abc123' - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await tasksClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/cloud_tasks.update_queue.js b/samples/generated/v2beta3/cloud_tasks.update_queue.js deleted file mode 100644 index 049b0d19..00000000 --- a/samples/generated/v2beta3/cloud_tasks.update_queue.js +++ /dev/null @@ -1,70 +0,0 @@ -// 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(queue) { - // [START cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_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 queue to create or update. - * The queue's name google.cloud.tasks.v2beta3.Queue.name must be specified. - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's name google.cloud.tasks.v2beta3.Queue.name cannot be changed. - */ - // const queue = {} - /** - * A mask used to specify which fields of the queue are being updated. - * If empty, then all fields will be updated. - */ - // const updateMask = {} - - // Imports the Tasks library - const {CloudTasksClient} = require('@google-cloud/tasks').v2beta3; - - // Instantiates a client - const tasksClient = new CloudTasksClient(); - - async function callUpdateQueue() { - // Construct request - const request = { - queue, - }; - - // Run request - const response = await tasksClient.updateQueue(request); - console.log(response); - } - - callUpdateQueue(); - // [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v2beta3/snippet_metadata.google.cloud.tasks.v2beta3.json b/samples/generated/v2beta3/snippet_metadata.google.cloud.tasks.v2beta3.json deleted file mode 100644 index ca24dc1e..00000000 --- a/samples/generated/v2beta3/snippet_metadata.google.cloud.tasks.v2beta3.json +++ /dev/null @@ -1,727 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-tasks", - "version": "3.0.5", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.tasks.v2beta3", - "version": "v2beta3" - } - ] - }, - "snippets": [ - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ListQueues_async", - "title": "tasks listQueues Sample", - "origin": "API_DEFINITION", - "description": " Lists queues. Queues are returned in lexicographical order.", - "canonical": true, - "file": "cloud_tasks.list_queues.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListQueues", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListQueues", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.ListQueuesResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "ListQueues", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListQueues", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetQueue_async", - "title": "tasks getQueue Sample", - "origin": "API_DEFINITION", - "description": " Gets a queue.", - "canonical": true, - "file": "cloud_tasks.get_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "read_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "GetQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_async", - "title": "tasks createQueue Sample", - "origin": "API_DEFINITION", - "description": " Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.create_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateQueue", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "queue", - "type": ".google.cloud.tasks.v2beta3.Queue" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "CreateQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_async", - "title": "tasks updateQueue Sample", - "origin": "API_DEFINITION", - "description": " Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.update_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue", - "async": true, - "parameters": [ - { - "name": "queue", - "type": ".google.cloud.tasks.v2beta3.Queue" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "UpdateQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_async", - "title": "tasks deleteQueue Sample", - "origin": "API_DEFINITION", - "description": " Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", - "canonical": true, - "file": "cloud_tasks.delete_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "DeleteQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_async", - "title": "tasks purgeQueue Sample", - "origin": "API_DEFINITION", - "description": " Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible.", - "canonical": true, - "file": "cloud_tasks.purge_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PurgeQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "PurgeQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_async", - "title": "tasks pauseQueue Sample", - "origin": "API_DEFINITION", - "description": " Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via [ResumeQueue][google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue]. Tasks can still be added when the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED].", - "canonical": true, - "file": "cloud_tasks.pause_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PauseQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PauseQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "PauseQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PauseQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_async", - "title": "tasks resumeQueue Sample", - "origin": "API_DEFINITION", - "description": " Resume a queue. This method resumes a queue after it has been [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED] or [DISABLED][google.cloud.tasks.v2beta3.Queue.State.DISABLED]. The state of a queue is stored in the queue's [state][google.cloud.tasks.v2beta3.Queue.state]; after calling this method it will be set to [RUNNING][google.cloud.tasks.v2beta3.Queue.State.RUNNING]. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in [Managing Cloud Tasks Scaling Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling).", - "canonical": true, - "file": "cloud_tasks.resume_queue.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResumeQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Queue", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "ResumeQueue", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async", - "title": "tasks getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.getIamPolicy`", - "canonical": true, - "file": "cloud_tasks.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicy", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async", - "title": "tasks setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy for a [Queue][google.cloud.tasks.v2beta3.Queue]. Replaces any existing policy. Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified resource parent: * `cloudtasks.queues.setIamPolicy`", - "canonical": true, - "file": "cloud_tasks.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicy", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async", - "title": "tasks testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that a caller has on a [Queue][google.cloud.tasks.v2beta3.Queue]. If the resource does not exist, this will return an empty set of permissions, not a [NOT_FOUND][google.rpc.Code.NOT_FOUND] error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", - "canonical": true, - "file": "cloud_tasks.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissions", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ListTasks_async", - "title": "tasks listTasks Sample", - "origin": "API_DEFINITION", - "description": " Lists the tasks in a queue. By default, only the [BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC] view is retrieved due to performance considerations; [response_view][google.cloud.tasks.v2beta3.ListTasksRequest.response_view] controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time.", - "canonical": true, - "file": "cloud_tasks.list_tasks.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListTasks", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta3.Task.View" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.ListTasksResponse", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "ListTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListTasks", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetTask_async", - "title": "tasks getTask Sample", - "origin": "API_DEFINITION", - "description": " Gets a task.", - "canonical": true, - "file": "cloud_tasks.get_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta3.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "GetTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_CreateTask_async", - "title": "tasks createTask Sample", - "origin": "API_DEFINITION", - "description": " Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB.", - "canonical": true, - "file": "cloud_tasks.create_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 100, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateTask", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "task", - "type": ".google.cloud.tasks.v2beta3.Task" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta3.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "CreateTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_async", - "title": "tasks deleteTask Sample", - "origin": "API_DEFINITION", - "description": " Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.", - "canonical": true, - "file": "cloud_tasks.delete_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "DeleteTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - }, - { - "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_RunTask_async", - "title": "tasks runTask Sample", - "origin": "API_DEFINITION", - "description": " Forces a task to run now. When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its [RateLimits][google.cloud.tasks.v2beta3.RateLimits] or is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. This command is meant to be used for manual debugging. For example, [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] will be reset to the time that [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] was called plus the retry delay specified in the queue's [RetryConfig][google.cloud.tasks.v2beta3.RetryConfig]. [RunTask][google.cloud.tasks.v2beta3.CloudTasks.RunTask] returns [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed.", - "canonical": true, - "file": "cloud_tasks.run_task.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.RunTask", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "response_view", - "type": ".google.cloud.tasks.v2beta3.Task.View" - } - ], - "resultType": ".google.cloud.tasks.v2beta3.Task", - "client": { - "shortName": "CloudTasksClient", - "fullName": "google.cloud.tasks.v2beta3.CloudTasksClient" - }, - "method": { - "shortName": "RunTask", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks.RunTask", - "service": { - "shortName": "CloudTasks", - "fullName": "google.cloud.tasks.v2beta3.CloudTasks" - } - } - } - } - ] -} \ No newline at end of file diff --git a/samples/test/test.samples.js b/samples/test/test.samples.js deleted file mode 100644 index 83543b9c..00000000 --- a/samples/test/test.samples.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -'use strict'; - -const {assert} = require('chai'); -const {describe, it, before} = require('mocha'); -const {execSync} = require('child_process'); -const uuid = require('uuid'); -const {CloudTasksClient} = require('@google-cloud/tasks'); - -const exec = cmd => execSync(cmd, {encoding: 'utf-8'}); -const queueName = `gcloud-${uuid.v4().split('-')[0]}`; -const SERVICE_ACCOUNT = - 'test-run-invoker@long-door-651.iam.gserviceaccount.com'; - -describe('Cloud Task Sample Tests', () => { - let url; - let projectId; - - before(async () => { - const client = new CloudTasksClient(); - projectId = await client.getProjectId(); - url = 'https://example.com/taskhandler'; - }); - - it('should create a queue', () => { - const stdout = exec(`node createQueue ${projectId} ${queueName}`); - assert.match(stdout, /Created queue/); - }); - - it('should create a task', () => { - const stdout = exec( - `node createTask ${projectId} ${queueName} us-central1` - ); - assert.match(stdout, /Created task/); - }); - - it('quickstart sample should create a task', () => { - const stdout = exec( - `node quickstart ${projectId} us-central1 ${queueName}` - ); - assert.match(stdout, /Created task/); - }); - - it('should create a HTTP task', () => { - const stdout = exec( - `node createHttpTask ${projectId} my-queue us-central1 ${url}` - ); - assert.match(stdout, /Created task/); - }); - - it('should create a HTTP task with token', () => { - const stdout = exec( - `node createHttpTaskWithToken ${projectId} my-queue us-central1 ${url} ${SERVICE_ACCOUNT}` - ); - assert.match(stdout, /Created task/); - }); - - it('should delete a queue', () => { - const stdout = exec(`node deleteQueue ${projectId} ${queueName}`); - assert.match(stdout, /Deleted queue/); - }); -}); diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 7eab6269..00000000 --- a/src/index.ts +++ /dev/null @@ -1,29 +0,0 @@ -// 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 v2 from './v2'; -import * as v2beta2 from './v2beta2'; -import * as v2beta3 from './v2beta3'; - -const CloudTasksClient = v2.CloudTasksClient; -type CloudTasksClient = v2.CloudTasksClient; - -export {v2, v2beta2, v2beta3, CloudTasksClient}; -export default {v2, v2beta2, v2beta3, CloudTasksClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/src/v2/cloud_tasks_client.ts b/src/v2/cloud_tasks_client.ts deleted file mode 100644 index 76832729..00000000 --- a/src/v2/cloud_tasks_client.ts +++ /dev/null @@ -1,2487 +0,0 @@ -// 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/v2/cloud_tasks_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cloud_tasks_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Tasks allows developers to manage the execution of background - * work in their applications. - * @class - * @memberof v2 - */ -export class CloudTasksClient { - 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}; - cloudTasksStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CloudTasksClient. - * - * @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 CloudTasksClient({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 CloudTasksClient; - 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 = { - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - queuePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/queues/{queue}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/queues/{queue}/tasks/{task}' - ), - }; - - // 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 = { - listQueues: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'queues' - ), - listTasks: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'tasks' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.tasks.v2.CloudTasks', - 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.cloudTasksStub) { - return this.cloudTasksStub; - } - - // Put together the "service stub" for - // google.cloud.tasks.v2.CloudTasks. - this.cloudTasksStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.tasks.v2.CloudTasks' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.tasks.v2.CloudTasks, - 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 cloudTasksStubMethods = [ - 'listQueues', - 'getQueue', - 'createQueue', - 'updateQueue', - 'deleteQueue', - 'purgeQueue', - 'pauseQueue', - 'resumeQueue', - 'getIamPolicy', - 'setIamPolicy', - 'testIamPermissions', - 'listTasks', - 'getTask', - 'createTask', - 'deleteTask', - 'runTask', - ]; - for (const methodName of cloudTasksStubMethods) { - const callPromise = this.cloudTasksStub.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.cloudTasksStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'cloudtasks.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 'cloudtasks.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * Gets a queue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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/v2/cloud_tasks.get_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_GetQueue_async - */ - getQueue( - request?: protos.google.cloud.tasks.v2.IGetQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IGetQueueRequest | undefined, - {} | undefined - ] - >; - getQueue( - request: protos.google.cloud.tasks.v2.IGetQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - getQueue( - request: protos.google.cloud.tasks.v2.IGetQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - getQueue( - request?: protos.google.cloud.tasks.v2.IGetQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IGetQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IGetQueueRequest | 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.getQueue(request, options, callback); - } - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of whether - * it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * {@link google.cloud.location.Locations.ListLocations|ListLocations}. - * @param {google.cloud.tasks.v2.Queue} request.queue - * Required. The queue to create. - * - * {@link google.cloud.tasks.v2.Queue.name|Queue's name} cannot be the same as an existing queue. - * @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 [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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/v2/cloud_tasks.create_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_CreateQueue_async - */ - createQueue( - request?: protos.google.cloud.tasks.v2.ICreateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.ICreateQueueRequest | undefined, - {} | undefined - ] - >; - createQueue( - request: protos.google.cloud.tasks.v2.ICreateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request: protos.google.cloud.tasks.v2.ICreateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request?: protos.google.cloud.tasks.v2.ICreateQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.ICreateQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.ICreateQueueRequest | 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.createQueue(request, options, callback); - } - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of whether - * it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.tasks.v2.Queue} request.queue - * Required. The queue to create or update. - * - * The queue's {@link google.cloud.tasks.v2.Queue.name|name} must be specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's {@link google.cloud.tasks.v2.Queue.name|name} cannot be changed. - * @param {google.protobuf.FieldMask} request.updateMask - * A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * @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 [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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/v2/cloud_tasks.update_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_UpdateQueue_async - */ - updateQueue( - request?: protos.google.cloud.tasks.v2.IUpdateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IUpdateQueueRequest | undefined, - {} | undefined - ] - >; - updateQueue( - request: protos.google.cloud.tasks.v2.IUpdateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request: protos.google.cloud.tasks.v2.IUpdateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request?: protos.google.cloud.tasks.v2.IUpdateQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IUpdateQueueRequest | 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({ - 'queue.name': request.queue!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateQueue(request, options, callback); - } - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/cloud_tasks.delete_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_DeleteQueue_async - */ - deleteQueue( - request?: protos.google.cloud.tasks.v2.IDeleteQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | undefined, - {} | undefined - ] - >; - deleteQueue( - request: protos.google.cloud.tasks.v2.IDeleteQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request: protos.google.cloud.tasks.v2.IDeleteQueueRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request?: protos.google.cloud.tasks.v2.IDeleteQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteQueueRequest | 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.deleteQueue(request, options, callback); - } - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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/v2/cloud_tasks.purge_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_PurgeQueue_async - */ - purgeQueue( - request?: protos.google.cloud.tasks.v2.IPurgeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPurgeQueueRequest | undefined, - {} | undefined - ] - >; - purgeQueue( - request: protos.google.cloud.tasks.v2.IPurgeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - purgeQueue( - request: protos.google.cloud.tasks.v2.IPurgeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - purgeQueue( - request?: protos.google.cloud.tasks.v2.IPurgeQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPurgeQueueRequest | 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.purgeQueue(request, options, callback); - } - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * {@link google.cloud.tasks.v2.CloudTasks.ResumeQueue|ResumeQueue}. Tasks can still be added - * when the queue is paused. A queue is paused if its - * {@link google.cloud.tasks.v2.Queue.state|state} is {@link google.cloud.tasks.v2.Queue.State.PAUSED|PAUSED}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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/v2/cloud_tasks.pause_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_PauseQueue_async - */ - pauseQueue( - request?: protos.google.cloud.tasks.v2.IPauseQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPauseQueueRequest | undefined, - {} | undefined - ] - >; - pauseQueue( - request: protos.google.cloud.tasks.v2.IPauseQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request: protos.google.cloud.tasks.v2.IPauseQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request?: protos.google.cloud.tasks.v2.IPauseQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPauseQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IPauseQueueRequest | 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.pauseQueue(request, options, callback); - } - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * {@link google.cloud.tasks.v2.Queue.State.PAUSED|PAUSED} or - * {@link google.cloud.tasks.v2.Queue.State.DISABLED|DISABLED}. The state of a queue is stored - * in the queue's {@link google.cloud.tasks.v2.Queue.state|state}; after calling this method it - * will be set to {@link google.cloud.tasks.v2.Queue.State.RUNNING|RUNNING}. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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/v2/cloud_tasks.resume_queue.js - * region_tag:cloudtasks_v2_generated_CloudTasks_ResumeQueue_async - */ - resumeQueue( - request?: protos.google.cloud.tasks.v2.IResumeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IResumeQueueRequest | undefined, - {} | undefined - ] - >; - resumeQueue( - request: protos.google.cloud.tasks.v2.IResumeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request: protos.google.cloud.tasks.v2.IResumeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request?: protos.google.cloud.tasks.v2.IResumeQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IResumeQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue, - protos.google.cloud.tasks.v2.IResumeQueueRequest | 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.resumeQueue(request, options, callback); - } - /** - * Gets the access control policy for a {@link google.cloud.tasks.v2.Queue|Queue}. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @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 [Policy]{@link google.iam.v1.Policy}. - * 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/v2/cloud_tasks.get_iam_policy.js - * region_tag:cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined - ] - >; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); - } - /** - * Sets the access control policy for a {@link google.cloud.tasks.v2.Queue|Queue}. Replaces any existing - * policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @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 [Policy]{@link google.iam.v1.Policy}. - * 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/v2/cloud_tasks.set_iam_policy.js - * region_tag:cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined - ] - >; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); - } - /** - * Returns permissions that a caller has on a {@link google.cloud.tasks.v2.Queue|Queue}. - * If the resource does not exist, this will return an empty set of - * permissions, not a {@link google.rpc.Code.NOT_FOUND|NOT_FOUND} error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * 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/v2/cloud_tasks.test_iam_permissions.js - * region_tag:cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); - } - /** - * Gets a task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.cloud.tasks.v2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2.Task}. - * 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/v2/cloud_tasks.get_task.js - * region_tag:cloudtasks_v2_generated_CloudTasks_GetTask_async - */ - getTask( - request?: protos.google.cloud.tasks.v2.IGetTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | undefined, - {} | undefined - ] - >; - getTask( - request: protos.google.cloud.tasks.v2.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request: protos.google.cloud.tasks.v2.IGetTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request?: protos.google.cloud.tasks.v2.IGetTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IGetTaskRequest | 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.getTask(request, options, callback); - } - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * The maximum task size is 100KB. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param {google.cloud.tasks.v2.Task} request.task - * Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task {@link google.cloud.tasks.v2.Task.name|name}. If a - * name is not specified then the system will generate a random - * unique task id, which will be set in the task returned in the - * {@link google.cloud.tasks.v2.Task.name|response}. - * - * If {@link google.cloud.tasks.v2.Task.schedule_time|schedule_time} is not set or is in the - * past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with {@link google.rpc.Code.ALREADY_EXISTS|ALREADY_EXISTS}. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these {@link google.cloud.tasks.v2.CloudTasks.CreateTask|CreateTask} calls have significantly - * increased latency. Using hashed strings for the task id or for - * the prefix of the task id is recommended. Choosing task ids that - * are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @param {google.cloud.tasks.v2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2.Task}. - * 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/v2/cloud_tasks.create_task.js - * region_tag:cloudtasks_v2_generated_CloudTasks_CreateTask_async - */ - createTask( - request?: protos.google.cloud.tasks.v2.ICreateTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | undefined, - {} | undefined - ] - >; - createTask( - request: protos.google.cloud.tasks.v2.ICreateTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request: protos.google.cloud.tasks.v2.ICreateTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request?: protos.google.cloud.tasks.v2.ICreateTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.ICreateTaskRequest | 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.createTask(request, options, callback); - } - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2/cloud_tasks.delete_task.js - * region_tag:cloudtasks_v2_generated_CloudTasks_DeleteTask_async - */ - deleteTask( - request?: protos.google.cloud.tasks.v2.IDeleteTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteTaskRequest | undefined, - {} | undefined - ] - >; - deleteTask( - request: protos.google.cloud.tasks.v2.IDeleteTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteTask( - request: protos.google.cloud.tasks.v2.IDeleteTaskRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteTask( - request?: protos.google.cloud.tasks.v2.IDeleteTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2.IDeleteTaskRequest | 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.deleteTask(request, options, callback); - } - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its {@link google.cloud.tasks.v2.RateLimits|RateLimits} or - * is {@link google.cloud.tasks.v2.Queue.State.PAUSED|PAUSED}. - * - * This command is meant to be used for manual debugging. For - * example, {@link google.cloud.tasks.v2.CloudTasks.RunTask|RunTask} can be used to retry a failed - * task after a fix has been made or to manually force a task to be - * dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the {@link Task.status|status} after the task is dispatched but - * before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * {@link google.cloud.tasks.v2.Task.schedule_time|schedule_time} will be reset to the time that - * {@link google.cloud.tasks.v2.CloudTasks.RunTask|RunTask} was called plus the retry delay specified - * in the queue's {@link google.cloud.tasks.v2.RetryConfig|RetryConfig}. - * - * {@link google.cloud.tasks.v2.CloudTasks.RunTask|RunTask} returns - * {@link google.rpc.Code.NOT_FOUND|NOT_FOUND} when it is called on a - * task that has already succeeded or permanently failed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.cloud.tasks.v2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2.Task}. - * 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/v2/cloud_tasks.run_task.js - * region_tag:cloudtasks_v2_generated_CloudTasks_RunTask_async - */ - runTask( - request?: protos.google.cloud.tasks.v2.IRunTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IRunTaskRequest | undefined, - {} | undefined - ] - >; - runTask( - request: protos.google.cloud.tasks.v2.IRunTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request: protos.google.cloud.tasks.v2.IRunTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request?: protos.google.cloud.tasks.v2.IRunTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IRunTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask, - protos.google.cloud.tasks.v2.IRunTaskRequest | 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.runTask(request, options, callback); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2.ListQueuesRequest.filter|filter} while iterating through pages. - * @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 [Queue]{@link google.cloud.tasks.v2.Queue}. - * 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 `listQueuesAsync()` - * 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. - */ - listQueues( - request?: protos.google.cloud.tasks.v2.IListQueuesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue[], - protos.google.cloud.tasks.v2.IListQueuesRequest | null, - protos.google.cloud.tasks.v2.IListQueuesResponse - ] - >; - listQueues( - request: protos.google.cloud.tasks.v2.IListQueuesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2.IListQueuesRequest, - protos.google.cloud.tasks.v2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2.IQueue - > - ): void; - listQueues( - request: protos.google.cloud.tasks.v2.IListQueuesRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2.IListQueuesRequest, - protos.google.cloud.tasks.v2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2.IQueue - > - ): void; - listQueues( - request?: protos.google.cloud.tasks.v2.IListQueuesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.tasks.v2.IListQueuesRequest, - protos.google.cloud.tasks.v2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2.IQueue - >, - callback?: PaginationCallback< - protos.google.cloud.tasks.v2.IListQueuesRequest, - protos.google.cloud.tasks.v2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2.IQueue - > - ): Promise< - [ - protos.google.cloud.tasks.v2.IQueue[], - protos.google.cloud.tasks.v2.IListQueuesRequest | null, - protos.google.cloud.tasks.v2.IListQueuesResponse - ] - > | 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.listQueues(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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2.ListQueuesRequest.filter|filter} while iterating through pages. - * @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 [Queue]{@link google.cloud.tasks.v2.Queue} 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 `listQueuesAsync()` - * 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. - */ - listQueuesStream( - request?: protos.google.cloud.tasks.v2.IListQueuesRequest, - 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['listQueues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listQueues.createStream( - this.innerApiCalls.listQueues as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listQueues`, 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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2.ListQueuesRequest.filter|filter} while iterating through pages. - * @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 - * [Queue]{@link google.cloud.tasks.v2.Queue}. 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/v2/cloud_tasks.list_queues.js - * region_tag:cloudtasks_v2_generated_CloudTasks_ListQueues_async - */ - listQueuesAsync( - request?: protos.google.cloud.tasks.v2.IListQueuesRequest, - 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['listQueues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listQueues.asyncIterate( - this.innerApiCalls['listQueues'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the tasks in a queue. - * - * By default, only the {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC} view is retrieved - * due to performance considerations; - * {@link google.cloud.tasks.v2.ListTasksRequest.response_view|response_view} controls the - * subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 [Task]{@link google.cloud.tasks.v2.Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.tasks.v2.IListTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask[], - protos.google.cloud.tasks.v2.IListTasksRequest | null, - protos.google.cloud.tasks.v2.IListTasksResponse - ] - >; - listTasks( - request: protos.google.cloud.tasks.v2.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2.IListTasksRequest, - protos.google.cloud.tasks.v2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2.ITask - > - ): void; - listTasks( - request: protos.google.cloud.tasks.v2.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2.IListTasksRequest, - protos.google.cloud.tasks.v2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2.ITask - > - ): void; - listTasks( - request?: protos.google.cloud.tasks.v2.IListTasksRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.tasks.v2.IListTasksRequest, - protos.google.cloud.tasks.v2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2.ITask - >, - callback?: PaginationCallback< - protos.google.cloud.tasks.v2.IListTasksRequest, - protos.google.cloud.tasks.v2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2.ITask - > - ): Promise< - [ - protos.google.cloud.tasks.v2.ITask[], - protos.google.cloud.tasks.v2.IListTasksRequest | null, - protos.google.cloud.tasks.v2.IListTasksResponse - ] - > | 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.listTasks(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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 [Task]{@link google.cloud.tasks.v2.Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.tasks.v2.IListTasksRequest, - 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['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listTasks`, 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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 - * [Task]{@link google.cloud.tasks.v2.Task}. 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/v2/cloud_tasks.list_tasks.js - * region_tag:cloudtasks_v2_generated_CloudTasks_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.tasks.v2.IListTasksRequest, - 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['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified 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 queue resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} queue - * @returns {string} Resource name string. - */ - queuePath(project: string, location: string, queue: string) { - return this.pathTemplates.queuePathTemplate.render({ - project: project, - location: location, - queue: queue, - }); - } - - /** - * Parse the project from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the project. - */ - matchProjectFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).project; - } - - /** - * Parse the location from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the location. - */ - matchLocationFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).location; - } - - /** - * Parse the queue from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the queue. - */ - matchQueueFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).queue; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} queue - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project: string, location: string, queue: string, task: string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - queue: queue, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the queue from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the queue. - */ - matchQueueFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).queue; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * 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.cloudTasksStub && !this._terminated) { - return this.cloudTasksStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/src/v2/cloud_tasks_client_config.json b/src/v2/cloud_tasks_client_config.json deleted file mode 100644 index 837e8667..00000000 --- a/src/v2/cloud_tasks_client_config.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "interfaces": { - "google.cloud.tasks.v2.CloudTasks": { - "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": 20000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - }, - "2607cc7256ff9acb2ee9b232c5722dbbaab18846": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListQueues": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "GetQueue": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "CreateQueue": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateQueue": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteQueue": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "PurgeQueue": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseQueue": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeQueue": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "SetIamPolicy": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "ListTasks": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "GetTask": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "CreateTask": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTask": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "RunTask": { - "timeout_millis": 10000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/src/v2/cloud_tasks_proto_list.json b/src/v2/cloud_tasks_proto_list.json deleted file mode 100644 index 1f64b04d..00000000 --- a/src/v2/cloud_tasks_proto_list.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "../../protos/google/cloud/tasks/v2/cloudtasks.proto", - "../../protos/google/cloud/tasks/v2/queue.proto", - "../../protos/google/cloud/tasks/v2/target.proto", - "../../protos/google/cloud/tasks/v2/task.proto" -] diff --git a/src/v2/gapic_metadata.json b/src/v2/gapic_metadata.json deleted file mode 100644 index 86370034..00000000 --- a/src/v2/gapic_metadata.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.tasks.v2", - "libraryPackage": "@google-cloud/tasks", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "CloudTasksClient", - "rpcs": { - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues", - "listQueuesStream", - "listQueuesAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CloudTasksClient", - "rpcs": { - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues", - "listQueuesStream", - "listQueuesAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - } - } -} diff --git a/src/v2/index.ts b/src/v2/index.ts deleted file mode 100644 index 5241381a..00000000 --- a/src/v2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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 {CloudTasksClient} from './cloud_tasks_client'; diff --git a/src/v2beta2/cloud_tasks_client.ts b/src/v2beta2/cloud_tasks_client.ts deleted file mode 100644 index 61c478d4..00000000 --- a/src/v2beta2/cloud_tasks_client.ts +++ /dev/null @@ -1,3052 +0,0 @@ -// 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/v2beta2/cloud_tasks_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cloud_tasks_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Tasks allows developers to manage the execution of background - * work in their applications. - * @class - * @memberof v2beta2 - */ -export class CloudTasksClient { - 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}; - cloudTasksStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CloudTasksClient. - * - * @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 CloudTasksClient({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 CloudTasksClient; - 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 = { - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - queuePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/queues/{queue}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/queues/{queue}/tasks/{task}' - ), - }; - - // 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 = { - listQueues: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'queues' - ), - listTasks: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'tasks' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.tasks.v2beta2.CloudTasks', - 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.cloudTasksStub) { - return this.cloudTasksStub; - } - - // Put together the "service stub" for - // google.cloud.tasks.v2beta2.CloudTasks. - this.cloudTasksStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.tasks.v2beta2.CloudTasks' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.tasks.v2beta2.CloudTasks, - 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 cloudTasksStubMethods = [ - 'listQueues', - 'getQueue', - 'createQueue', - 'updateQueue', - 'deleteQueue', - 'purgeQueue', - 'pauseQueue', - 'resumeQueue', - 'getIamPolicy', - 'setIamPolicy', - 'testIamPermissions', - 'listTasks', - 'getTask', - 'createTask', - 'deleteTask', - 'leaseTasks', - 'acknowledgeTask', - 'renewLease', - 'cancelLease', - 'runTask', - ]; - for (const methodName of cloudTasksStubMethods) { - const callPromise = this.cloudTasksStub.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.cloudTasksStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'cloudtasks.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 'cloudtasks.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * Gets a queue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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/v2beta2/cloud_tasks.get_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_GetQueue_async - */ - getQueue( - request?: protos.google.cloud.tasks.v2beta2.IGetQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IGetQueueRequest | undefined, - {} | undefined - ] - >; - getQueue( - request: protos.google.cloud.tasks.v2beta2.IGetQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - getQueue( - request: protos.google.cloud.tasks.v2beta2.IGetQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - getQueue( - request?: protos.google.cloud.tasks.v2beta2.IGetQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IGetQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IGetQueueRequest | 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.getQueue(request, options, callback); - } - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of whether - * it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * {@link google.cloud.location.Locations.ListLocations|ListLocations}. - * @param {google.cloud.tasks.v2beta2.Queue} request.queue - * Required. The queue to create. - * - * {@link google.cloud.tasks.v2beta2.Queue.name|Queue's name} cannot be the same as an existing queue. - * @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 [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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/v2beta2/cloud_tasks.create_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_async - */ - createQueue( - request?: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | undefined, - {} | undefined - ] - >; - createQueue( - request: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request?: protos.google.cloud.tasks.v2beta2.ICreateQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - | protos.google.cloud.tasks.v2beta2.ICreateQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.ICreateQueueRequest | 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.createQueue(request, options, callback); - } - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of whether - * it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.tasks.v2beta2.Queue} request.queue - * Required. The queue to create or update. - * - * The queue's {@link google.cloud.tasks.v2beta2.Queue.name|name} must be specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's {@link google.cloud.tasks.v2beta2.Queue.name|name} cannot be changed. - * @param {google.protobuf.FieldMask} request.updateMask - * A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * @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 [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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/v2beta2/cloud_tasks.update_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_async - */ - updateQueue( - request?: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | undefined, - {} | undefined - ] - >; - updateQueue( - request: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request?: protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - | protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IUpdateQueueRequest | 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({ - 'queue.name': request.queue!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateQueue(request, options, callback); - } - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2beta2/cloud_tasks.delete_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_async - */ - deleteQueue( - request?: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | undefined, - {} | undefined - ] - >; - deleteQueue( - request: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request?: protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteQueueRequest | 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.deleteQueue(request, options, callback); - } - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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/v2beta2/cloud_tasks.purge_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_async - */ - purgeQueue( - request?: protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest | undefined, - {} | undefined - ] - >; - purgeQueue( - request: protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - purgeQueue( - request: protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - purgeQueue( - request?: protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - | protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPurgeQueueRequest | 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.purgeQueue(request, options, callback); - } - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * {@link google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue|ResumeQueue}. Tasks can still be added - * when the queue is paused. A queue is paused if its - * {@link google.cloud.tasks.v2beta2.Queue.state|state} is {@link google.cloud.tasks.v2beta2.Queue.State.PAUSED|PAUSED}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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/v2beta2/cloud_tasks.pause_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_async - */ - pauseQueue( - request?: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | undefined, - {} | undefined - ] - >; - pauseQueue( - request: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request?: protos.google.cloud.tasks.v2beta2.IPauseQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - | protos.google.cloud.tasks.v2beta2.IPauseQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IPauseQueueRequest | 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.pauseQueue(request, options, callback); - } - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * {@link google.cloud.tasks.v2beta2.Queue.State.PAUSED|PAUSED} or - * {@link google.cloud.tasks.v2beta2.Queue.State.DISABLED|DISABLED}. The state of a queue is stored - * in the queue's {@link google.cloud.tasks.v2beta2.Queue.state|state}; after calling this method it - * will be set to {@link google.cloud.tasks.v2beta2.Queue.State.RUNNING|RUNNING}. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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/v2beta2/cloud_tasks.resume_queue.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_async - */ - resumeQueue( - request?: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | undefined, - {} | undefined - ] - >; - resumeQueue( - request: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request?: protos.google.cloud.tasks.v2beta2.IResumeQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - | protos.google.cloud.tasks.v2beta2.IResumeQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue, - protos.google.cloud.tasks.v2beta2.IResumeQueueRequest | 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.resumeQueue(request, options, callback); - } - /** - * Gets the access control policy for a {@link google.cloud.tasks.v2beta2.Queue|Queue}. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @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 [Policy]{@link google.iam.v1.Policy}. - * 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/v2beta2/cloud_tasks.get_iam_policy.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined - ] - >; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); - } - /** - * Sets the access control policy for a {@link google.cloud.tasks.v2beta2.Queue|Queue}. Replaces any existing - * policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @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 [Policy]{@link google.iam.v1.Policy}. - * 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/v2beta2/cloud_tasks.set_iam_policy.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined - ] - >; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); - } - /** - * Returns permissions that a caller has on a {@link google.cloud.tasks.v2beta2.Queue|Queue}. - * If the resource does not exist, this will return an empty set of - * permissions, not a {@link google.rpc.Code.NOT_FOUND|NOT_FOUND} error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * 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/v2beta2/cloud_tasks.test_iam_permissions.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); - } - /** - * Gets a task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta2.Task}. - * 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/v2beta2/cloud_tasks.get_task.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_GetTask_async - */ - getTask( - request?: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | undefined, - {} | undefined - ] - >; - getTask( - request: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request?: protos.google.cloud.tasks.v2beta2.IGetTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IGetTaskRequest | 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.getTask(request, options, callback); - } - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * For {@link google.cloud.tasks.v2beta2.AppEngineHttpTarget|App Engine queues}, the maximum task size is - * 100KB. - * * For {@link google.cloud.tasks.v2beta2.PullTarget|pull queues}, the maximum task size is 1MB. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param {google.cloud.tasks.v2beta2.Task} request.task - * Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task {@link google.cloud.tasks.v2beta2.Task.name|name}. If a - * name is not specified then the system will generate a random - * unique task id, which will be set in the task returned in the - * {@link google.cloud.tasks.v2beta2.Task.name|response}. - * - * If {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} is not set or is in the - * past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or completed recently then the call will fail - * with {@link google.rpc.Code.ALREADY_EXISTS|ALREADY_EXISTS}. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or completed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or completed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these {@link google.cloud.tasks.v2beta2.CloudTasks.CreateTask|CreateTask} calls have significantly - * increased latency. Using hashed strings for the task id or for - * the prefix of the task id is recommended. Choosing task ids that - * are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta2.Task}. - * 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/v2beta2/cloud_tasks.create_task.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_CreateTask_async - */ - createTask( - request?: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | undefined, - {} | undefined - ] - >; - createTask( - request: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request?: protos.google.cloud.tasks.v2beta2.ICreateTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.ITask, - | protos.google.cloud.tasks.v2beta2.ICreateTaskRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICreateTaskRequest | 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.createTask(request, options, callback); - } - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has completed successfully or permanently - * failed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2beta2/cloud_tasks.delete_task.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_async - */ - deleteTask( - request?: protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest | undefined, - {} | undefined - ] - >; - deleteTask( - request: protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteTask( - request: protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteTask( - request?: protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IDeleteTaskRequest | 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.deleteTask(request, options, callback); - } - /** - * Leases tasks from a pull queue for - * {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration|lease_duration}. - * - * This method is invoked by the worker to obtain a lease. The - * worker must acknowledge the task via - * {@link google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask|AcknowledgeTask} after they have - * performed the work associated with the task. - * - * The {@link google.cloud.tasks.v2beta2.PullMessage.payload|payload} is intended to store data that - * the worker needs to perform the work associated with the task. To - * return the payloads in the {@link google.cloud.tasks.v2beta2.LeaseTasksResponse|response}, set - * {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.response_view|response_view} to - * {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL}. - * - * A maximum of 10 qps of {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks} - * requests are allowed per - * queue. {@link google.rpc.Code.RESOURCE_EXHAUSTED|RESOURCE_EXHAUSTED} - * is returned when this limit is - * exceeded. {@link google.rpc.Code.RESOURCE_EXHAUSTED|RESOURCE_EXHAUSTED} - * is also returned when - * {@link google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second|max_tasks_dispatched_per_second} - * is exceeded. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {number} request.maxTasks - * The maximum number of tasks to lease. - * - * The system will make a best effort to return as close to as - * `max_tasks` as possible. - * - * The largest that `max_tasks` can be is 1000. - * - * The maximum total size of a {@link google.cloud.tasks.v2beta2.LeaseTasksResponse|lease tasks response} is - * 32 MB. If the sum of all task sizes requested reaches this limit, - * fewer tasks than requested are returned. - * @param {google.protobuf.Duration} request.leaseDuration - * Required. The duration of the lease. - * - * Each task returned in the {@link google.cloud.tasks.v2beta2.LeaseTasksResponse|response} will - * have its {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} set to the current - * time plus the `lease_duration`. The task is leased until its - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time}; thus, the task will not be - * returned to another {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks} call - * before its {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time}. - * - * - * After the worker has successfully finished the work associated - * with the task, the worker must call via - * {@link google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask|AcknowledgeTask} before the - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time}. Otherwise the task will be - * returned to a later {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks} call so - * that another worker can retry it. - * - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {string} request.filter - * `filter` can be used to specify a subset of tasks to lease. - * - * When `filter` is set to `tag=` then the - * {@link google.cloud.tasks.v2beta2.LeaseTasksResponse|response} will contain only tasks whose - * {@link google.cloud.tasks.v2beta2.PullMessage.tag|tag} is equal to ``. `` must be - * less than 500 characters. - * - * When `filter` is set to `tag_function=oldest_tag()`, only tasks which have - * the same tag as the task with the oldest - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} will be returned. - * - * Grammar Syntax: - * - * * `filter = "tag=" tag | "tag_function=" function` - * - * * `tag = string` - * - * * `function = "oldest_tag()"` - * - * The `oldest_tag()` function returns tasks which have the same tag as the - * oldest task (ordered by schedule time). - * - * SDK compatibility: Although the SDK allows tags to be either - * string or - * [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which - * aren't UTF-8 encoded can't be used in the - * {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.filter|filter} and the task's - * {@link google.cloud.tasks.v2beta2.PullMessage.tag|tag} will be displayed as empty in Cloud Tasks. - * @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 [LeaseTasksResponse]{@link google.cloud.tasks.v2beta2.LeaseTasksResponse}. - * 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/v2beta2/cloud_tasks.lease_tasks.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_async - */ - leaseTasks( - request?: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | undefined, - {} | undefined - ] - >; - leaseTasks( - request: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, - {} | null | undefined - > - ): void; - leaseTasks( - request: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, - {} | null | undefined - > - ): void; - leaseTasks( - request?: protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - | protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse, - protos.google.cloud.tasks.v2beta2.ILeaseTasksRequest | 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.leaseTasks(request, options, callback); - } - /** - * Acknowledges a pull task. - * - * The worker, that is, the entity that - * {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|leased} this task must call this method - * to indicate that the work associated with the task has finished. - * - * The worker must acknowledge a task within the - * {@link google.cloud.tasks.v2beta2.LeaseTasksRequest.lease_duration|lease_duration} or the lease - * will expire and the task will become available to be leased - * again. After the task is acknowledged, it will not be returned - * by a later {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks}, - * {@link google.cloud.tasks.v2beta2.CloudTasks.GetTask|GetTask}, or - * {@link google.cloud.tasks.v2beta2.CloudTasks.ListTasks|ListTasks}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.protobuf.Timestamp} request.scheduleTime - * Required. The task's current schedule time, available in the - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} returned by - * {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks} response or - * {@link google.cloud.tasks.v2beta2.CloudTasks.RenewLease|RenewLease} response. This restriction is - * to ensure that your worker currently holds the lease. - * @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/v2beta2/cloud_tasks.acknowledge_task.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_async - */ - acknowledgeTask( - request?: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest | undefined, - {} | undefined - ] - >; - acknowledgeTask( - request: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest - | null - | undefined, - {} | null | undefined - > - ): void; - acknowledgeTask( - request: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest - | null - | undefined, - {} | null | undefined - > - ): void; - acknowledgeTask( - request?: protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta2.IAcknowledgeTaskRequest | 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.acknowledgeTask(request, options, callback); - } - /** - * Renew the current lease of a pull task. - * - * The worker can use this method to extend the lease by a new - * duration, starting from now. The new task lease will be - * returned in the task's {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.protobuf.Timestamp} request.scheduleTime - * Required. The task's current schedule time, available in the - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} returned by - * {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks} response or - * {@link google.cloud.tasks.v2beta2.CloudTasks.RenewLease|RenewLease} response. This restriction is - * to ensure that your worker currently holds the lease. - * @param {google.protobuf.Duration} request.leaseDuration - * Required. The desired new lease duration, starting from now. - * - * - * The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta2.Task}. - * 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/v2beta2/cloud_tasks.renew_lease.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_RenewLease_async - */ - renewLease( - request?: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | undefined, - {} | undefined - ] - >; - renewLease( - request: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; - renewLease( - request: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; - renewLease( - request?: protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.ITask, - | protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRenewLeaseRequest | 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.renewLease(request, options, callback); - } - /** - * Cancel a pull task's lease. - * - * The worker can use this method to cancel a task's lease by - * setting its {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} to now. This will - * make the task available to be leased to the next caller of - * {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.protobuf.Timestamp} request.scheduleTime - * Required. The task's current schedule time, available in the - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} returned by - * {@link google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks|LeaseTasks} response or - * {@link google.cloud.tasks.v2beta2.CloudTasks.RenewLease|RenewLease} response. This restriction is - * to ensure that your worker currently holds the lease. - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta2.Task}. - * 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/v2beta2/cloud_tasks.cancel_lease.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_CancelLease_async - */ - cancelLease( - request?: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | undefined, - {} | undefined - ] - >; - cancelLease( - request: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; - cancelLease( - request: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, - {} | null | undefined - > - ): void; - cancelLease( - request?: protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.ITask, - | protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.ICancelLeaseRequest | 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.cancelLease(request, options, callback); - } - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its {@link google.cloud.tasks.v2beta2.RateLimits|RateLimits} or - * is {@link google.cloud.tasks.v2beta2.Queue.State.PAUSED|PAUSED}. - * - * This command is meant to be used for manual debugging. For - * example, {@link google.cloud.tasks.v2beta2.CloudTasks.RunTask|RunTask} can be used to retry a failed - * task after a fix has been made or to manually force a task to be - * dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the {@link google.cloud.tasks.v2beta2.Task.status|status} after the task is dispatched but - * before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * {@link google.cloud.tasks.v2beta2.Task.schedule_time|schedule_time} will be reset to the time that - * {@link google.cloud.tasks.v2beta2.CloudTasks.RunTask|RunTask} was called plus the retry delay specified - * in the queue's {@link google.cloud.tasks.v2beta2.RetryConfig|RetryConfig}. - * - * {@link google.cloud.tasks.v2beta2.CloudTasks.RunTask|RunTask} returns - * {@link google.rpc.Code.NOT_FOUND|NOT_FOUND} when it is called on a - * task that has already succeeded or permanently failed. - * - * {@link google.cloud.tasks.v2beta2.CloudTasks.RunTask|RunTask} cannot be called on a - * {@link google.cloud.tasks.v2beta2.PullMessage|pull task}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta2.Task}. - * 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/v2beta2/cloud_tasks.run_task.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_RunTask_async - */ - runTask( - request?: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | undefined, - {} | undefined - ] - >; - runTask( - request: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request?: protos.google.cloud.tasks.v2beta2.IRunTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask, - protos.google.cloud.tasks.v2beta2.IRunTaskRequest | 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.runTask(request, options, callback); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2beta2.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "app_engine_http_target: *". - * - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta2.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2beta2.ListQueuesRequest.filter|filter} while iterating through pages. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 [Queue]{@link google.cloud.tasks.v2beta2.Queue}. - * 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 `listQueuesAsync()` - * 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. - */ - listQueues( - request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue[], - protos.google.cloud.tasks.v2beta2.IListQueuesRequest | null, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse - ] - >; - listQueues( - request: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.IQueue - > - ): void; - listQueues( - request: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.IQueue - > - ): void; - listQueues( - request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - | protos.google.cloud.tasks.v2beta2.IListQueuesResponse - | null - | undefined, - protos.google.cloud.tasks.v2beta2.IQueue - >, - callback?: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.IQueue - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.IQueue[], - protos.google.cloud.tasks.v2beta2.IListQueuesRequest | null, - protos.google.cloud.tasks.v2beta2.IListQueuesResponse - ] - > | 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.listQueues(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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2beta2.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "app_engine_http_target: *". - * - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta2.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2beta2.ListQueuesRequest.filter|filter} while iterating through pages. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 [Queue]{@link google.cloud.tasks.v2beta2.Queue} 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 `listQueuesAsync()` - * 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. - */ - listQueuesStream( - request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - 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['listQueues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listQueues.createStream( - this.innerApiCalls.listQueues as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listQueues`, 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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2beta2.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "app_engine_http_target: *". - * - * Note that using filters might cause fewer queues than the - * requested_page size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta2.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta2.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2beta2.ListQueuesRequest.filter|filter} while iterating through pages. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 - * [Queue]{@link google.cloud.tasks.v2beta2.Queue}. 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/v2beta2/cloud_tasks.list_queues.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_ListQueues_async - */ - listQueuesAsync( - request?: protos.google.cloud.tasks.v2beta2.IListQueuesRequest, - 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['listQueues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listQueues.asyncIterate( - this.innerApiCalls['listQueues'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the tasks in a queue. - * - * By default, only the {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC} view is retrieved - * due to performance considerations; - * {@link google.cloud.tasks.v2beta2.ListTasksRequest.response_view|response_view} controls the - * subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta2.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 [Task]{@link google.cloud.tasks.v2beta2.Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask[], - protos.google.cloud.tasks.v2beta2.IListTasksRequest | null, - protos.google.cloud.tasks.v2beta2.IListTasksResponse - ] - >; - listTasks( - request: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListTasksRequest, - protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.ITask - > - ): void; - listTasks( - request: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListTasksRequest, - protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.ITask - > - ): void; - listTasks( - request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListTasksRequest, - | protos.google.cloud.tasks.v2beta2.IListTasksResponse - | null - | undefined, - protos.google.cloud.tasks.v2beta2.ITask - >, - callback?: PaginationCallback< - protos.google.cloud.tasks.v2beta2.IListTasksRequest, - protos.google.cloud.tasks.v2beta2.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta2.ITask - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta2.ITask[], - protos.google.cloud.tasks.v2beta2.IListTasksRequest | null, - protos.google.cloud.tasks.v2beta2.IListTasksResponse - ] - > | 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.listTasks(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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta2.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 [Task]{@link google.cloud.tasks.v2beta2.Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - 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['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listTasks`, 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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2beta2.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta2.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta2.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta2.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta2.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta2.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta2.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 - * [Task]{@link google.cloud.tasks.v2beta2.Task}. 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/v2beta2/cloud_tasks.list_tasks.js - * region_tag:cloudtasks_v2beta2_generated_CloudTasks_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.tasks.v2beta2.IListTasksRequest, - 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['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified 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 queue resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} queue - * @returns {string} Resource name string. - */ - queuePath(project: string, location: string, queue: string) { - return this.pathTemplates.queuePathTemplate.render({ - project: project, - location: location, - queue: queue, - }); - } - - /** - * Parse the project from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the project. - */ - matchProjectFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).project; - } - - /** - * Parse the location from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the location. - */ - matchLocationFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).location; - } - - /** - * Parse the queue from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the queue. - */ - matchQueueFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).queue; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} queue - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project: string, location: string, queue: string, task: string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - queue: queue, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the queue from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the queue. - */ - matchQueueFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).queue; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * 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.cloudTasksStub && !this._terminated) { - return this.cloudTasksStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/src/v2beta2/cloud_tasks_client_config.json b/src/v2beta2/cloud_tasks_client_config.json deleted file mode 100644 index a1f0b2ed..00000000 --- a/src/v2beta2/cloud_tasks_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.cloud.tasks.v2beta2.CloudTasks": { - "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": 20000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - }, - "2607cc7256ff9acb2ee9b232c5722dbbaab18846": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListQueues": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "GetQueue": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteQueue": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "SetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "ListTasks": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "GetTask": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTask": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "LeaseTasks": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AcknowledgeTask": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RenewLease": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelLease": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RunTask": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/src/v2beta2/cloud_tasks_proto_list.json b/src/v2beta2/cloud_tasks_proto_list.json deleted file mode 100644 index ff72584b..00000000 --- a/src/v2beta2/cloud_tasks_proto_list.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "../../protos/google/cloud/tasks/v2beta2/cloudtasks.proto", - "../../protos/google/cloud/tasks/v2beta2/queue.proto", - "../../protos/google/cloud/tasks/v2beta2/target.proto", - "../../protos/google/cloud/tasks/v2beta2/task.proto" -] diff --git a/src/v2beta2/gapic_metadata.json b/src/v2beta2/gapic_metadata.json deleted file mode 100644 index d7bdcec3..00000000 --- a/src/v2beta2/gapic_metadata.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.tasks.v2beta2", - "libraryPackage": "@google-cloud/tasks", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "CloudTasksClient", - "rpcs": { - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "LeaseTasks": { - "methods": [ - "leaseTasks" - ] - }, - "AcknowledgeTask": { - "methods": [ - "acknowledgeTask" - ] - }, - "RenewLease": { - "methods": [ - "renewLease" - ] - }, - "CancelLease": { - "methods": [ - "cancelLease" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues", - "listQueuesStream", - "listQueuesAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CloudTasksClient", - "rpcs": { - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "LeaseTasks": { - "methods": [ - "leaseTasks" - ] - }, - "AcknowledgeTask": { - "methods": [ - "acknowledgeTask" - ] - }, - "RenewLease": { - "methods": [ - "renewLease" - ] - }, - "CancelLease": { - "methods": [ - "cancelLease" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues", - "listQueuesStream", - "listQueuesAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - } - } -} diff --git a/src/v2beta2/index.ts b/src/v2beta2/index.ts deleted file mode 100644 index 5241381a..00000000 --- a/src/v2beta2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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 {CloudTasksClient} from './cloud_tasks_client'; diff --git a/src/v2beta3/cloud_tasks_client.ts b/src/v2beta3/cloud_tasks_client.ts deleted file mode 100644 index 558957b7..00000000 --- a/src/v2beta3/cloud_tasks_client.ts +++ /dev/null @@ -1,2527 +0,0 @@ -// 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/v2beta3/cloud_tasks_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cloud_tasks_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Cloud Tasks allows developers to manage the execution of background - * work in their applications. - * @class - * @memberof v2beta3 - */ -export class CloudTasksClient { - 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}; - cloudTasksStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of CloudTasksClient. - * - * @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 CloudTasksClient({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 CloudTasksClient; - 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 = { - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - queuePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/queues/{queue}' - ), - taskPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/queues/{queue}/tasks/{task}' - ), - }; - - // 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 = { - listQueues: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'queues' - ), - listTasks: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'tasks' - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.tasks.v2beta3.CloudTasks', - 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.cloudTasksStub) { - return this.cloudTasksStub; - } - - // Put together the "service stub" for - // google.cloud.tasks.v2beta3.CloudTasks. - this.cloudTasksStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.cloud.tasks.v2beta3.CloudTasks' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.tasks.v2beta3.CloudTasks, - 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 cloudTasksStubMethods = [ - 'listQueues', - 'getQueue', - 'createQueue', - 'updateQueue', - 'deleteQueue', - 'purgeQueue', - 'pauseQueue', - 'resumeQueue', - 'getIamPolicy', - 'setIamPolicy', - 'testIamPermissions', - 'listTasks', - 'getTask', - 'createTask', - 'deleteTask', - 'runTask', - ]; - for (const methodName of cloudTasksStubMethods) { - const callPromise = this.cloudTasksStub.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.cloudTasksStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'cloudtasks.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 'cloudtasks.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return ['https://www.googleapis.com/auth/cloud-platform']; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * Gets a queue. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the queue. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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/v2beta3/cloud_tasks.get_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_GetQueue_async - */ - getQueue( - request?: protos.google.cloud.tasks.v2beta3.IGetQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IGetQueueRequest | undefined, - {} | undefined - ] - >; - getQueue( - request: protos.google.cloud.tasks.v2beta3.IGetQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - getQueue( - request: protos.google.cloud.tasks.v2beta3.IGetQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - getQueue( - request?: protos.google.cloud.tasks.v2beta3.IGetQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IGetQueueRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IGetQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IGetQueueRequest | 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.getQueue(request, options, callback); - } - /** - * Creates a queue. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of whether - * it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name in which the queue will be created. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * - * The list of allowed locations can be obtained by calling Cloud - * Tasks' implementation of - * {@link google.cloud.location.Locations.ListLocations|ListLocations}. - * @param {google.cloud.tasks.v2beta3.Queue} request.queue - * Required. The queue to create. - * - * {@link google.cloud.tasks.v2beta3.Queue.name|Queue's name} cannot be the same as an existing queue. - * @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 [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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/v2beta3/cloud_tasks.create_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_async - */ - createQueue( - request?: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | undefined, - {} | undefined - ] - >; - createQueue( - request: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - createQueue( - request?: protos.google.cloud.tasks.v2beta3.ICreateQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - | protos.google.cloud.tasks.v2beta3.ICreateQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.ICreateQueueRequest | 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.createQueue(request, options, callback); - } - /** - * Updates a queue. - * - * This method creates the queue if it does not exist and updates - * the queue if it does exist. - * - * Queues created with this method allow tasks to live for a maximum of 31 - * days. After a task is 31 days old, the task will be deleted regardless of whether - * it was dispatched or not. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.tasks.v2beta3.Queue} request.queue - * Required. The queue to create or update. - * - * The queue's {@link google.cloud.tasks.v2beta3.Queue.name|name} must be specified. - * - * Output only fields cannot be modified using UpdateQueue. - * Any value specified for an output only field will be ignored. - * The queue's {@link google.cloud.tasks.v2beta3.Queue.name|name} cannot be changed. - * @param {google.protobuf.FieldMask} request.updateMask - * A mask used to specify which fields of the queue are being updated. - * - * If empty, then all fields will be updated. - * @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 [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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/v2beta3/cloud_tasks.update_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_async - */ - updateQueue( - request?: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | undefined, - {} | undefined - ] - >; - updateQueue( - request: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - updateQueue( - request?: protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - | protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IUpdateQueueRequest | 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({ - 'queue.name': request.queue!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateQueue(request, options, callback); - } - /** - * Deletes a queue. - * - * This command will delete the queue even if it has tasks in it. - * - * Note: If you delete a queue, a queue with the same name can't be created - * for 7 days. - * - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read - * [Overview of Queue Management and - * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using - * this method. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2beta3/cloud_tasks.delete_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_async - */ - deleteQueue( - request?: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | undefined, - {} | undefined - ] - >; - deleteQueue( - request: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteQueue( - request?: protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteQueueRequest | 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.deleteQueue(request, options, callback); - } - /** - * Purges a queue by deleting all of its tasks. - * - * All tasks created before this method is called are permanently deleted. - * - * Purge operations can take up to one minute to take effect. Tasks - * might be dispatched before the purge takes effect. A purge is irreversible. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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/v2beta3/cloud_tasks.purge_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_async - */ - purgeQueue( - request?: protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest | undefined, - {} | undefined - ] - >; - purgeQueue( - request: protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - purgeQueue( - request: protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - purgeQueue( - request?: protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - | protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPurgeQueueRequest | 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.purgeQueue(request, options, callback); - } - /** - * Pauses the queue. - * - * If a queue is paused then the system will stop dispatching tasks - * until the queue is resumed via - * {@link google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue|ResumeQueue}. Tasks can still be added - * when the queue is paused. A queue is paused if its - * {@link google.cloud.tasks.v2beta3.Queue.state|state} is {@link google.cloud.tasks.v2beta3.Queue.State.PAUSED|PAUSED}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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/v2beta3/cloud_tasks.pause_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_async - */ - pauseQueue( - request?: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | undefined, - {} | undefined - ] - >; - pauseQueue( - request: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - pauseQueue( - request?: protos.google.cloud.tasks.v2beta3.IPauseQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - | protos.google.cloud.tasks.v2beta3.IPauseQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IPauseQueueRequest | 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.pauseQueue(request, options, callback); - } - /** - * Resume a queue. - * - * This method resumes a queue after it has been - * {@link google.cloud.tasks.v2beta3.Queue.State.PAUSED|PAUSED} or - * {@link google.cloud.tasks.v2beta3.Queue.State.DISABLED|DISABLED}. The state of a queue is stored - * in the queue's {@link google.cloud.tasks.v2beta3.Queue.state|state}; after calling this method it - * will be set to {@link google.cloud.tasks.v2beta3.Queue.State.RUNNING|RUNNING}. - * - * WARNING: Resuming many high-QPS queues at the same time can - * lead to target overloading. If you are resuming high-QPS - * queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](https://cloud.google.com/tasks/docs/manage-cloud-task-scaling). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The queue name. For example: - * `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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/v2beta3/cloud_tasks.resume_queue.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_async - */ - resumeQueue( - request?: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | undefined, - {} | undefined - ] - >; - resumeQueue( - request: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): void; - resumeQueue( - request?: protos.google.cloud.tasks.v2beta3.IResumeQueueRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - | protos.google.cloud.tasks.v2beta3.IResumeQueueRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue, - protos.google.cloud.tasks.v2beta3.IResumeQueueRequest | 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.resumeQueue(request, options, callback); - } - /** - * Gets the access control policy for a {@link google.cloud.tasks.v2beta3.Queue|Queue}. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.getIamPolicy` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @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 [Policy]{@link google.iam.v1.Policy}. - * 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/v2beta3/cloud_tasks.get_iam_policy.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | undefined, - {} | undefined - ] - >; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); - } - /** - * Sets the access control policy for a {@link google.cloud.tasks.v2beta3.Queue|Queue}. Replaces any existing - * policy. - * - * Note: The Cloud Console does not check queue-level IAM permissions yet. - * Project-level permissions are required to use the Cloud Console. - * - * Authorization requires the following - * [Google IAM](https://cloud.google.com/iam) permission on the specified - * resource parent: - * - * * `cloudtasks.queues.setIamPolicy` - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @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 [Policy]{@link google.iam.v1.Policy}. - * 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/v2beta3/cloud_tasks.set_iam_policy.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | undefined, - {} | undefined - ] - >; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); - } - /** - * Returns permissions that a caller has on a {@link google.cloud.tasks.v2beta3.Queue|Queue}. - * If the resource does not exist, this will return an empty set of - * permissions, not a {@link google.rpc.Code.NOT_FOUND|NOT_FOUND} error. - * - * Note: This operation is designed to be used for building permission-aware - * UIs and command-line tools, not for authorization checking. This operation - * may "fail open" without warning. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @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 [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * 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/v2beta3/cloud_tasks.test_iam_permissions.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | undefined, - {} | undefined - ] - >; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest | 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({ - resource: request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); - } - /** - * Gets a task. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.cloud.tasks.v2beta3.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta3.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta3.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta3.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. - * 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/v2beta3/cloud_tasks.get_task.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_GetTask_async - */ - getTask( - request?: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | undefined, - {} | undefined - ] - >; - getTask( - request: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - getTask( - request?: protos.google.cloud.tasks.v2beta3.IGetTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IGetTaskRequest | 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.getTask(request, options, callback); - } - /** - * Creates a task and adds it to a queue. - * - * Tasks cannot be updated after creation; there is no UpdateTask command. - * - * * The maximum task size is 100KB. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * - * The queue must already exist. - * @param {google.cloud.tasks.v2beta3.Task} request.task - * Required. The task to add. - * - * Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task {@link google.cloud.tasks.v2beta3.Task.name|name}. If a - * name is not specified then the system will generate a random - * unique task id, which will be set in the task returned in the - * {@link google.cloud.tasks.v2beta3.Task.name|response}. - * - * If {@link google.cloud.tasks.v2beta3.Task.schedule_time|schedule_time} is not set or is in the - * past then Cloud Tasks will set it to the current time. - * - * Task De-duplication: - * - * Explicitly specifying a task ID enables task de-duplication. If - * a task's ID is identical to that of an existing task or a task - * that was deleted or executed recently then the call will fail - * with {@link google.rpc.Code.ALREADY_EXISTS|ALREADY_EXISTS}. - * If the task's queue was created using Cloud Tasks, then another task with - * the same name can't be created for ~1hour after the original task was - * deleted or executed. If the task's queue was created using queue.yaml or - * queue.xml, then another task with the same name can't be created - * for ~9days after the original task was deleted or executed. - * - * Because there is an extra lookup cost to identify duplicate task - * names, these {@link google.cloud.tasks.v2beta3.CloudTasks.CreateTask|CreateTask} calls have significantly - * increased latency. Using hashed strings for the task id or for - * the prefix of the task id is recommended. Choosing task ids that - * are sequential or have sequential prefixes, for example using a - * timestamp, causes an increase in latency and error rates in all - * task commands. The infrastructure relies on an approximately - * uniform distribution of task ids to store and serve tasks - * efficiently. - * @param {google.cloud.tasks.v2beta3.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta3.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta3.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta3.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. - * 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/v2beta3/cloud_tasks.create_task.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_CreateTask_async - */ - createTask( - request?: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | undefined, - {} | undefined - ] - >; - createTask( - request: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - createTask( - request?: protos.google.cloud.tasks.v2beta3.ICreateTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.ITask, - | protos.google.cloud.tasks.v2beta3.ICreateTaskRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.ICreateTaskRequest | 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.createTask(request, options, callback); - } - /** - * Deletes a task. - * - * A task can be deleted if it is scheduled or dispatched. A task - * cannot be deleted if it has executed successfully or permanently - * failed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v2beta3/cloud_tasks.delete_task.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_async - */ - deleteTask( - request?: protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest | undefined, - {} | undefined - ] - >; - deleteTask( - request: protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteTask( - request: protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - deleteTask( - request?: protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.protobuf.IEmpty, - | protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.protobuf.IEmpty, - protos.google.cloud.tasks.v2beta3.IDeleteTaskRequest | 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.deleteTask(request, options, callback); - } - /** - * Forces a task to run now. - * - * When this method is called, Cloud Tasks will dispatch the task, even if - * the task is already running, the queue has reached its {@link google.cloud.tasks.v2beta3.RateLimits|RateLimits} or - * is {@link google.cloud.tasks.v2beta3.Queue.State.PAUSED|PAUSED}. - * - * This command is meant to be used for manual debugging. For - * example, {@link google.cloud.tasks.v2beta3.CloudTasks.RunTask|RunTask} can be used to retry a failed - * task after a fix has been made or to manually force a task to be - * dispatched now. - * - * The dispatched task is returned. That is, the task that is returned - * contains the {@link Task.status|status} after the task is dispatched but - * before the task is received by its target. - * - * If Cloud Tasks receives a successful response from the task's - * target, then the task will be deleted; otherwise the task's - * {@link google.cloud.tasks.v2beta3.Task.schedule_time|schedule_time} will be reset to the time that - * {@link google.cloud.tasks.v2beta3.CloudTasks.RunTask|RunTask} was called plus the retry delay specified - * in the queue's {@link google.cloud.tasks.v2beta3.RetryConfig|RetryConfig}. - * - * {@link google.cloud.tasks.v2beta3.CloudTasks.RunTask|RunTask} returns - * {@link google.rpc.Code.NOT_FOUND|NOT_FOUND} when it is called on a - * task that has already succeeded or permanently failed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The task name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {google.cloud.tasks.v2beta3.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta3.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta3.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta3.Task|Task} resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Task]{@link google.cloud.tasks.v2beta3.Task}. - * 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/v2beta3/cloud_tasks.run_task.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_RunTask_async - */ - runTask( - request?: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | undefined, - {} | undefined - ] - >; - runTask( - request: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - callback: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): void; - runTask( - request?: protos.google.cloud.tasks.v2beta3.IRunTaskRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask, - protos.google.cloud.tasks.v2beta3.IRunTaskRequest | 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.runTask(request, options, callback); - } - - /** - * Lists queues. - * - * Queues are returned in lexicographical order. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2beta3.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta3.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2beta3.ListQueuesRequest.filter|filter} while iterating through pages. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 [Queue]{@link google.cloud.tasks.v2beta3.Queue}. - * 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 `listQueuesAsync()` - * 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. - */ - listQueues( - request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue[], - protos.google.cloud.tasks.v2beta3.IListQueuesRequest | null, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse - ] - >; - listQueues( - request: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.IQueue - > - ): void; - listQueues( - request: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.IQueue - > - ): void; - listQueues( - request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - | protos.google.cloud.tasks.v2beta3.IListQueuesResponse - | null - | undefined, - protos.google.cloud.tasks.v2beta3.IQueue - >, - callback?: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.IQueue - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.IQueue[], - protos.google.cloud.tasks.v2beta3.IListQueuesRequest | null, - protos.google.cloud.tasks.v2beta3.IListQueuesResponse - ] - > | 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.listQueues(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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2beta3.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta3.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2beta3.ListQueuesRequest.filter|filter} while iterating through pages. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 [Queue]{@link google.cloud.tasks.v2beta3.Queue} 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 `listQueuesAsync()` - * 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. - */ - listQueuesStream( - request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - 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['listQueues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listQueues.createStream( - this.innerApiCalls.listQueues as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listQueues`, 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 location name. - * For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {string} request.filter - * `filter` can be used to specify a subset of queues. Any {@link google.cloud.tasks.v2beta3.Queue|Queue} - * field can be used as a filter and several operators as supported. - * For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as - * described in - * [Stackdriver's Advanced Logs - * Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * - * Sample filter "state: PAUSED". - * - * Note that using filters might cause fewer queues than the - * requested page_size to be returned. - * @param {number} request.pageSize - * Requested page size. - * - * The maximum page size is 9800. If unspecified, the page size will - * be the maximum. Fewer queues than requested might be returned, - * even if more queues exist; use the - * {@link google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token|next_page_token} in the - * response to determine if more queues exist. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta3.ListQueuesResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta3.CloudTasks.ListQueues|ListQueues} - * method. It is an error to switch the value of the - * {@link google.cloud.tasks.v2beta3.ListQueuesRequest.filter|filter} while iterating through pages. - * @param {google.protobuf.FieldMask} [request.readMask] - * Optional. Read mask is used for a more granular control over what the API returns. - * If the mask is not present all fields will be returned except - * [Queue.stats]. [Queue.stats] will be returned only if it was explicitly - * specified in the mask. - * @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 - * [Queue]{@link google.cloud.tasks.v2beta3.Queue}. 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/v2beta3/cloud_tasks.list_queues.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_ListQueues_async - */ - listQueuesAsync( - request?: protos.google.cloud.tasks.v2beta3.IListQueuesRequest, - 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['listQueues']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listQueues.asyncIterate( - this.innerApiCalls['listQueues'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists the tasks in a queue. - * - * By default, only the {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC} view is retrieved - * due to performance considerations; - * {@link google.cloud.tasks.v2beta3.ListTasksRequest.response_view|response_view} controls the - * subset of information which is returned. - * - * The tasks may be returned in any order. The ordering may change at any - * time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2beta3.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta3.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta3.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta3.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta3.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 [Task]{@link google.cloud.tasks.v2beta3.Task}. - * 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 `listTasksAsync()` - * 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. - */ - listTasks( - request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask[], - protos.google.cloud.tasks.v2beta3.IListTasksRequest | null, - protos.google.cloud.tasks.v2beta3.IListTasksResponse - ] - >; - listTasks( - request: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListTasksRequest, - protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.ITask - > - ): void; - listTasks( - request: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - callback: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListTasksRequest, - protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.ITask - > - ): void; - listTasks( - request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListTasksRequest, - | protos.google.cloud.tasks.v2beta3.IListTasksResponse - | null - | undefined, - protos.google.cloud.tasks.v2beta3.ITask - >, - callback?: PaginationCallback< - protos.google.cloud.tasks.v2beta3.IListTasksRequest, - protos.google.cloud.tasks.v2beta3.IListTasksResponse | null | undefined, - protos.google.cloud.tasks.v2beta3.ITask - > - ): Promise< - [ - protos.google.cloud.tasks.v2beta3.ITask[], - protos.google.cloud.tasks.v2beta3.IListTasksRequest | null, - protos.google.cloud.tasks.v2beta3.IListTasksResponse - ] - > | 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.listTasks(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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2beta3.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta3.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta3.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta3.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta3.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 [Task]{@link google.cloud.tasks.v2beta3.Task} 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 `listTasksAsync()` - * 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. - */ - listTasksStream( - request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - 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['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.createStream( - this.innerApiCalls.listTasks as GaxCall, - request, - callSettings - ); - } - - /** - * Equivalent to `listTasks`, 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 queue name. For example: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {google.cloud.tasks.v2beta3.Task.View} request.responseView - * The response_view specifies which subset of the {@link google.cloud.tasks.v2beta3.Task|Task} will be - * returned. - * - * By default response_view is {@link google.cloud.tasks.v2beta3.Task.View.BASIC|BASIC}; not all - * information is retrieved by default because some data, such as - * payloads, might be desirable to return only when needed because - * of its large size or because of the sensitivity of data that it - * contains. - * - * Authorization for {@link google.cloud.tasks.v2beta3.Task.View.FULL|FULL} requires - * `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) - * permission on the {@link google.cloud.tasks.v2beta3.Task|Task} resource. - * @param {number} request.pageSize - * Maximum page size. - * - * Fewer tasks than requested might be returned, even if more tasks exist; use - * {@link google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token|next_page_token} in the response to - * determine if more tasks exist. - * - * The maximum page size is 1000. If unspecified, the page size will be the - * maximum. - * @param {string} request.pageToken - * A token identifying the page of results to return. - * - * To request the first page results, page_token must be empty. To - * request the next page of results, page_token must be the value of - * {@link google.cloud.tasks.v2beta3.ListTasksResponse.next_page_token|next_page_token} returned - * from the previous call to {@link google.cloud.tasks.v2beta3.CloudTasks.ListTasks|ListTasks} - * method. - * - * The page token is valid for only 2 hours. - * @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 - * [Task]{@link google.cloud.tasks.v2beta3.Task}. 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/v2beta3/cloud_tasks.list_tasks.js - * region_tag:cloudtasks_v2beta3_generated_CloudTasks_ListTasks_async - */ - listTasksAsync( - request?: protos.google.cloud.tasks.v2beta3.IListTasksRequest, - 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['listTasks']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTasks.asyncIterate( - this.innerApiCalls['listTasks'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project: string, location: string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified 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 queue resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} queue - * @returns {string} Resource name string. - */ - queuePath(project: string, location: string, queue: string) { - return this.pathTemplates.queuePathTemplate.render({ - project: project, - location: location, - queue: queue, - }); - } - - /** - * Parse the project from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the project. - */ - matchProjectFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).project; - } - - /** - * Parse the location from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the location. - */ - matchLocationFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).location; - } - - /** - * Parse the queue from Queue resource. - * - * @param {string} queueName - * A fully-qualified path representing Queue resource. - * @returns {string} A string representing the queue. - */ - matchQueueFromQueueName(queueName: string) { - return this.pathTemplates.queuePathTemplate.match(queueName).queue; - } - - /** - * Return a fully-qualified task resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} queue - * @param {string} task - * @returns {string} Resource name string. - */ - taskPath(project: string, location: string, queue: string, task: string) { - return this.pathTemplates.taskPathTemplate.render({ - project: project, - location: location, - queue: queue, - task: task, - }); - } - - /** - * Parse the project from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).project; - } - - /** - * Parse the location from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the location. - */ - matchLocationFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).location; - } - - /** - * Parse the queue from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the queue. - */ - matchQueueFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).queue; - } - - /** - * Parse the task from Task resource. - * - * @param {string} taskName - * A fully-qualified path representing Task resource. - * @returns {string} A string representing the task. - */ - matchTaskFromTaskName(taskName: string) { - return this.pathTemplates.taskPathTemplate.match(taskName).task; - } - - /** - * 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.cloudTasksStub && !this._terminated) { - return this.cloudTasksStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/src/v2beta3/cloud_tasks_client_config.json b/src/v2beta3/cloud_tasks_client_config.json deleted file mode 100644 index 0eb3420f..00000000 --- a/src/v2beta3/cloud_tasks_client_config.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "interfaces": { - "google.cloud.tasks.v2beta3.CloudTasks": { - "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": 20000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - }, - "2607cc7256ff9acb2ee9b232c5722dbbaab18846": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListQueues": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "GetQueue": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "CreateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteQueue": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "PurgeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PauseQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResumeQueue": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "SetIamPolicy": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "ListTasks": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "GetTask": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "CreateTask": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTask": { - "timeout_millis": 20000, - "retry_codes_name": "idempotent", - "retry_params_name": "2607cc7256ff9acb2ee9b232c5722dbbaab18846" - }, - "RunTask": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/src/v2beta3/cloud_tasks_proto_list.json b/src/v2beta3/cloud_tasks_proto_list.json deleted file mode 100644 index 2d67b2d9..00000000 --- a/src/v2beta3/cloud_tasks_proto_list.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - "../../protos/google/cloud/tasks/v2beta3/cloudtasks.proto", - "../../protos/google/cloud/tasks/v2beta3/queue.proto", - "../../protos/google/cloud/tasks/v2beta3/target.proto", - "../../protos/google/cloud/tasks/v2beta3/task.proto" -] diff --git a/src/v2beta3/gapic_metadata.json b/src/v2beta3/gapic_metadata.json deleted file mode 100644 index 16ade9d3..00000000 --- a/src/v2beta3/gapic_metadata.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.tasks.v2beta3", - "libraryPackage": "@google-cloud/tasks", - "services": { - "CloudTasks": { - "clients": { - "grpc": { - "libraryClient": "CloudTasksClient", - "rpcs": { - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues", - "listQueuesStream", - "listQueuesAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "CloudTasksClient", - "rpcs": { - "GetQueue": { - "methods": [ - "getQueue" - ] - }, - "CreateQueue": { - "methods": [ - "createQueue" - ] - }, - "UpdateQueue": { - "methods": [ - "updateQueue" - ] - }, - "DeleteQueue": { - "methods": [ - "deleteQueue" - ] - }, - "PurgeQueue": { - "methods": [ - "purgeQueue" - ] - }, - "PauseQueue": { - "methods": [ - "pauseQueue" - ] - }, - "ResumeQueue": { - "methods": [ - "resumeQueue" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "GetTask": { - "methods": [ - "getTask" - ] - }, - "CreateTask": { - "methods": [ - "createTask" - ] - }, - "DeleteTask": { - "methods": [ - "deleteTask" - ] - }, - "RunTask": { - "methods": [ - "runTask" - ] - }, - "ListQueues": { - "methods": [ - "listQueues", - "listQueuesStream", - "listQueuesAsync" - ] - }, - "ListTasks": { - "methods": [ - "listTasks", - "listTasksStream", - "listTasksAsync" - ] - } - } - } - } - } - } -} diff --git a/src/v2beta3/index.ts b/src/v2beta3/index.ts deleted file mode 100644 index 5241381a..00000000 --- a/src/v2beta3/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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 {CloudTasksClient} from './cloud_tasks_client'; diff --git a/system-test/fixtures/sample/src/index.js b/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 00d43c7d..00000000 --- a/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,26 +0,0 @@ -// 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 tasks = require('@google-cloud/tasks'); - -function main() { - const cloudTasksClient = new tasks.CloudTasksClient(); -} - -main(); diff --git a/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 2381981b..00000000 --- a/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// 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 {CloudTasksClient} from '@google-cloud/tasks'; - -// check that the client class type name can be used -function doStuffWithCloudTasksClient(client: CloudTasksClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const cloudTasksClient = new CloudTasksClient(); - doStuffWithCloudTasksClient(cloudTasksClient); -} - -main(); diff --git a/system-test/install.ts b/system-test/install.ts deleted file mode 100644 index 6dd1eaad..00000000 --- a/system-test/install.ts +++ /dev/null @@ -1,51 +0,0 @@ -// 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/test/gapic_cloud_tasks_v2.ts b/test/gapic_cloud_tasks_v2.ts deleted file mode 100644 index 58caa0c3..00000000 --- a/test/gapic_cloud_tasks_v2.ts +++ /dev/null @@ -1,2865 +0,0 @@ -// 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 cloudtasksModule 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('v2.CloudTasksClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = cloudtasksModule.v2.CloudTasksClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = cloudtasksModule.v2.CloudTasksClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = cloudtasksModule.v2.CloudTasksClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new cloudtasksModule.v2.CloudTasksClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudTasksStub, undefined); - await client.initialize(); - assert(client.cloudTasksStub); - }); - - it('has close method for the initialized client', done => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.cloudTasksStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudTasksStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudtasksModule.v2.CloudTasksClient({ - 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 cloudtasksModule.v2.CloudTasksClient({ - 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('getQueue', () => { - it('invokes getQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.getQueue = stubSimpleCall(expectedResponse); - const [response] = await client.getQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.getQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getQueue = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getQueue(request), expectedError); - }); - }); - - describe('createQueue', () => { - it('invokes createQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.createQueue = stubSimpleCall(expectedResponse); - const [response] = await client.createQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.createQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createQueue(request), expectedError); - }); - }); - - describe('updateQueue', () => { - it('invokes updateQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.updateQueue = stubSimpleCall(expectedResponse); - const [response] = await client.updateQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.updateQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.updateQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateQueue(request), expectedError); - }); - }); - - describe('deleteQueue', () => { - it('invokes deleteQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteQueue = stubSimpleCall(expectedResponse); - const [response] = await client.deleteQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteQueue( - 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.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteQueue(request), expectedError); - }); - }); - - describe('purgeQueue', () => { - it('invokes purgeQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.purgeQueue = stubSimpleCall(expectedResponse); - const [response] = await client.purgeQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.purgeQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.purgeQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.purgeQueue(request), expectedError); - }); - }); - - describe('pauseQueue', () => { - it('invokes pauseQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.pauseQueue = stubSimpleCall(expectedResponse); - const [response] = await client.pauseQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.pauseQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.pauseQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseQueue(request), expectedError); - }); - }); - - describe('resumeQueue', () => { - it('invokes resumeQueue without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.resumeQueue = stubSimpleCall(expectedResponse); - const [response] = await client.resumeQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Queue() - ); - client.innerApiCalls.resumeQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.resumeQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeQueue(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = - stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.ITestIamPermissionsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Task() - ); - client.innerApiCalls.getTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('createTask', () => { - it('invokes createTask without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Task() - ); - client.innerApiCalls.createTask = stubSimpleCall(expectedResponse); - const [response] = await client.createTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Task() - ); - client.innerApiCalls.createTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTask(request), expectedError); - }); - }); - - describe('deleteTask', () => { - it('invokes deleteTask without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTask = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTask( - 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.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTask(request), expectedError); - }); - }); - - describe('runTask', () => { - it('invokes runTask without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Task() - ); - client.innerApiCalls.runTask = stubSimpleCall(expectedResponse); - const [response] = await client.runTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2.Task() - ); - client.innerApiCalls.runTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runTask(request), expectedError); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask with closed client', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runTask(request), expectedError); - }); - }); - - describe('listQueues', () => { - it('invokes listQueues without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - ]; - client.innerApiCalls.listQueues = stubSimpleCall(expectedResponse); - const [response] = await client.listQueues(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueues without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - ]; - client.innerApiCalls.listQueues = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listQueues( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.IQueue[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueues with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listQueues = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.listQueues(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueuesStream without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - ]; - client.descriptors.page.listQueues.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listQueuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2.Queue[] = []; - stream.on('data', (response: protos.google.cloud.tasks.v2.Queue) => { - 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.listQueues.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listQueues, request) - ); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listQueuesStream with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listQueues.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listQueuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2.Queue[] = []; - stream.on('data', (response: protos.google.cloud.tasks.v2.Queue) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listQueues, request) - ); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listQueues without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Queue()), - ]; - client.descriptors.page.listQueues.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.tasks.v2.IQueue[] = []; - const iterable = client.listQueuesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listQueues.asyncIterate as SinonStub).getCall( - 0 - ).args[1], - request - ); - assert( - (client.descriptors.page.listQueues.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listQueues with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listQueues.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listQueuesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.tasks.v2.IQueue[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listQueues.asyncIterate as SinonStub).getCall( - 0 - ).args[1], - request - ); - assert( - (client.descriptors.page.listQueues.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - ]; - client.innerApiCalls.listTasks = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2.ITask[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - ]; - client.descriptors.page.listTasks.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2.Task[] = []; - stream.on('data', (response: protos.google.cloud.tasks.v2.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listTasks, request) - ); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2.Task[] = []; - stream.on('data', (response: protos.google.cloud.tasks.v2.Task) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listTasks, request) - ); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.tasks.v2.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.tasks.v2.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('project', () => { - const fakePath = '/rendered/path/project'; - const expectedParameters = { - project: 'projectValue', - }; - const client = new cloudtasksModule.v2.CloudTasksClient({ - 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('queue', () => { - const fakePath = '/rendered/path/queue'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - queue: 'queueValue', - }; - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.queuePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.queuePathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('queuePath', () => { - const result = client.queuePath( - 'projectValue', - 'locationValue', - 'queueValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.queuePathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromQueueName', () => { - const result = client.matchProjectFromQueueName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromQueueName', () => { - const result = client.matchLocationFromQueueName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchQueueFromQueueName', () => { - const result = client.matchQueueFromQueueName(fakePath); - assert.strictEqual(result, 'queueValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('task', () => { - const fakePath = '/rendered/path/task'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - queue: 'queueValue', - task: 'taskValue', - }; - const client = new cloudtasksModule.v2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.taskPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath( - 'projectValue', - 'locationValue', - 'queueValue', - 'taskValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchQueueFromTaskName', () => { - const result = client.matchQueueFromTaskName(fakePath); - assert.strictEqual(result, 'queueValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, 'taskValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - }); -}); diff --git a/test/gapic_cloud_tasks_v2beta2.ts b/test/gapic_cloud_tasks_v2beta2.ts deleted file mode 100644 index 430f4d0b..00000000 --- a/test/gapic_cloud_tasks_v2beta2.ts +++ /dev/null @@ -1,3397 +0,0 @@ -// 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 cloudtasksModule 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('v2beta2.CloudTasksClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = cloudtasksModule.v2beta2.CloudTasksClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = cloudtasksModule.v2beta2.CloudTasksClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = cloudtasksModule.v2beta2.CloudTasksClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudTasksStub, undefined); - await client.initialize(); - assert(client.cloudTasksStub); - }); - - it('has close method for the initialized client', done => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.cloudTasksStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudTasksStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - 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 cloudtasksModule.v2beta2.CloudTasksClient({ - 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('getQueue', () => { - it('invokes getQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.getQueue = stubSimpleCall(expectedResponse); - const [response] = await client.getQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.getQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getQueue = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getQueue(request), expectedError); - }); - }); - - describe('createQueue', () => { - it('invokes createQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.createQueue = stubSimpleCall(expectedResponse); - const [response] = await client.createQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.createQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createQueue(request), expectedError); - }); - }); - - describe('updateQueue', () => { - it('invokes updateQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.updateQueue = stubSimpleCall(expectedResponse); - const [response] = await client.updateQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.updateQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.updateQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateQueue(request), expectedError); - }); - }); - - describe('deleteQueue', () => { - it('invokes deleteQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteQueue = stubSimpleCall(expectedResponse); - const [response] = await client.deleteQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteQueue( - 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.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteQueue(request), expectedError); - }); - }); - - describe('purgeQueue', () => { - it('invokes purgeQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.purgeQueue = stubSimpleCall(expectedResponse); - const [response] = await client.purgeQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.purgeQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.purgeQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.purgeQueue(request), expectedError); - }); - }); - - describe('pauseQueue', () => { - it('invokes pauseQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.pauseQueue = stubSimpleCall(expectedResponse); - const [response] = await client.pauseQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.pauseQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.pauseQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseQueue(request), expectedError); - }); - }); - - describe('resumeQueue', () => { - it('invokes resumeQueue without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.resumeQueue = stubSimpleCall(expectedResponse); - const [response] = await client.resumeQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Queue() - ); - client.innerApiCalls.resumeQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.resumeQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeQueue(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = - stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.ITestIamPermissionsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.getTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('createTask', () => { - it('invokes createTask without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.createTask = stubSimpleCall(expectedResponse); - const [response] = await client.createTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.createTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTask(request), expectedError); - }); - }); - - describe('deleteTask', () => { - it('invokes deleteTask without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTask = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTask( - 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.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTask(request), expectedError); - }); - }); - - describe('leaseTasks', () => { - it('invokes leaseTasks without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.LeaseTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.LeaseTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.LeaseTasksResponse() - ); - client.innerApiCalls.leaseTasks = stubSimpleCall(expectedResponse); - const [response] = await client.leaseTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.leaseTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.leaseTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes leaseTasks without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.LeaseTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.LeaseTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.LeaseTasksResponse() - ); - client.innerApiCalls.leaseTasks = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.leaseTasks( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ILeaseTasksResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.leaseTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.leaseTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes leaseTasks with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.LeaseTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.LeaseTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.leaseTasks = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.leaseTasks(request), expectedError); - const actualRequest = ( - client.innerApiCalls.leaseTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.leaseTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes leaseTasks with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.LeaseTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.LeaseTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.leaseTasks(request), expectedError); - }); - }); - - describe('acknowledgeTask', () => { - it('invokes acknowledgeTask without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.acknowledgeTask = stubSimpleCall(expectedResponse); - const [response] = await client.acknowledgeTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.acknowledgeTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.acknowledgeTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledgeTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.acknowledgeTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.acknowledgeTask( - 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.acknowledgeTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.acknowledgeTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledgeTask with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.acknowledgeTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.acknowledgeTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.acknowledgeTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.acknowledgeTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes acknowledgeTask with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.AcknowledgeTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.acknowledgeTask(request), expectedError); - }); - }); - - describe('renewLease', () => { - it('invokes renewLease without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RenewLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RenewLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.renewLease = stubSimpleCall(expectedResponse); - const [response] = await client.renewLease(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.renewLease as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.renewLease as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes renewLease without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RenewLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RenewLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.renewLease = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.renewLease( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.renewLease as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.renewLease as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes renewLease with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RenewLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RenewLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.renewLease = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.renewLease(request), expectedError); - const actualRequest = ( - client.innerApiCalls.renewLease as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.renewLease as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes renewLease with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RenewLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RenewLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.renewLease(request), expectedError); - }); - }); - - describe('cancelLease', () => { - it('invokes cancelLease without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CancelLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CancelLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.cancelLease = stubSimpleCall(expectedResponse); - const [response] = await client.cancelLease(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.cancelLease as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.cancelLease as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelLease without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CancelLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CancelLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.cancelLease = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelLease( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.cancelLease as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.cancelLease as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelLease with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CancelLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CancelLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelLease = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.cancelLease(request), expectedError); - const actualRequest = ( - client.innerApiCalls.cancelLease as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.cancelLease as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelLease with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.CancelLeaseRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.CancelLeaseRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelLease(request), expectedError); - }); - }); - - describe('runTask', () => { - it('invokes runTask without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.runTask = stubSimpleCall(expectedResponse); - const [response] = await client.runTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.Task() - ); - client.innerApiCalls.runTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runTask(request), expectedError); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask with closed client', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runTask(request), expectedError); - }); - }); - - describe('listQueues', () => { - it('invokes listQueues without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - ]; - client.innerApiCalls.listQueues = stubSimpleCall(expectedResponse); - const [response] = await client.listQueues(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueues without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - ]; - client.innerApiCalls.listQueues = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listQueues( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.IQueue[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueues with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listQueues = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.listQueues(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueuesStream without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - ]; - client.descriptors.page.listQueues.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listQueuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta2.Queue[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta2.Queue) => { - 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.listQueues.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listQueues, request) - ); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listQueuesStream with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listQueues.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listQueuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta2.Queue[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta2.Queue) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listQueues, request) - ); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listQueues without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Queue()), - ]; - client.descriptors.page.listQueues.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.tasks.v2beta2.IQueue[] = []; - const iterable = client.listQueuesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listQueues.asyncIterate as SinonStub).getCall( - 0 - ).args[1], - request - ); - assert( - (client.descriptors.page.listQueues.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listQueues with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listQueues.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listQueuesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.tasks.v2beta2.IQueue[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listQueues.asyncIterate as SinonStub).getCall( - 0 - ).args[1], - request - ); - assert( - (client.descriptors.page.listQueues.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - ]; - client.innerApiCalls.listTasks = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta2.ITask[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - ]; - client.descriptors.page.listTasks.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta2.Task[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta2.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listTasks, request) - ); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta2.Task[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta2.Task) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listTasks, request) - ); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta2.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.tasks.v2beta2.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta2.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta2.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.tasks.v2beta2.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('project', () => { - const fakePath = '/rendered/path/project'; - const expectedParameters = { - project: 'projectValue', - }; - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - 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('queue', () => { - const fakePath = '/rendered/path/queue'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - queue: 'queueValue', - }; - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.queuePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.queuePathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('queuePath', () => { - const result = client.queuePath( - 'projectValue', - 'locationValue', - 'queueValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.queuePathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromQueueName', () => { - const result = client.matchProjectFromQueueName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromQueueName', () => { - const result = client.matchLocationFromQueueName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchQueueFromQueueName', () => { - const result = client.matchQueueFromQueueName(fakePath); - assert.strictEqual(result, 'queueValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('task', () => { - const fakePath = '/rendered/path/task'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - queue: 'queueValue', - task: 'taskValue', - }; - const client = new cloudtasksModule.v2beta2.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.taskPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath( - 'projectValue', - 'locationValue', - 'queueValue', - 'taskValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchQueueFromTaskName', () => { - const result = client.matchQueueFromTaskName(fakePath); - assert.strictEqual(result, 'queueValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, 'taskValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - }); -}); diff --git a/test/gapic_cloud_tasks_v2beta3.ts b/test/gapic_cloud_tasks_v2beta3.ts deleted file mode 100644 index 97476e4a..00000000 --- a/test/gapic_cloud_tasks_v2beta3.ts +++ /dev/null @@ -1,2877 +0,0 @@ -// 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 cloudtasksModule 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('v2beta3.CloudTasksClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = cloudtasksModule.v2beta3.CloudTasksClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = cloudtasksModule.v2beta3.CloudTasksClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = cloudtasksModule.v2beta3.CloudTasksClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudTasksStub, undefined); - await client.initialize(); - assert(client.cloudTasksStub); - }); - - it('has close method for the initialized client', done => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.cloudTasksStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudTasksStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - 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 cloudtasksModule.v2beta3.CloudTasksClient({ - 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('getQueue', () => { - it('invokes getQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.getQueue = stubSimpleCall(expectedResponse); - const [response] = await client.getQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.getQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getQueue = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getQueue(request), expectedError); - }); - }); - - describe('createQueue', () => { - it('invokes createQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.createQueue = stubSimpleCall(expectedResponse); - const [response] = await client.createQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.createQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateQueueRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createQueue(request), expectedError); - }); - }); - - describe('updateQueue', () => { - it('invokes updateQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.updateQueue = stubSimpleCall(expectedResponse); - const [response] = await client.updateQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.updateQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedHeaderRequestParams = `queue.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.updateQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.UpdateQueueRequest() - ); - request.queue ??= {}; - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.UpdateQueueRequest', - ['queue', 'name'] - ); - request.queue.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateQueue(request), expectedError); - }); - }); - - describe('deleteQueue', () => { - it('invokes deleteQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteQueue = stubSimpleCall(expectedResponse); - const [response] = await client.deleteQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteQueue( - 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.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteQueue(request), expectedError); - }); - }); - - describe('purgeQueue', () => { - it('invokes purgeQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.purgeQueue = stubSimpleCall(expectedResponse); - const [response] = await client.purgeQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.purgeQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.purgeQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.purgeQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.purgeQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.purgeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes purgeQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PurgeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PurgeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.purgeQueue(request), expectedError); - }); - }); - - describe('pauseQueue', () => { - it('invokes pauseQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.pauseQueue = stubSimpleCall(expectedResponse); - const [response] = await client.pauseQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.pauseQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pauseQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.pauseQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.pauseQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.pauseQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pauseQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.PauseQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.PauseQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pauseQueue(request), expectedError); - }); - }); - - describe('resumeQueue', () => { - it('invokes resumeQueue without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.resumeQueue = stubSimpleCall(expectedResponse); - const [response] = await client.resumeQueue(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Queue() - ); - client.innerApiCalls.resumeQueue = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resumeQueue( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.resumeQueue = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.resumeQueue(request), expectedError); - const actualRequest = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.resumeQueue as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resumeQueue with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ResumeQueueRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ResumeQueueRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resumeQueue(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.GetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.IPolicy | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.setIamPolicy as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.SetIamPolicyRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = - stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - ( - err?: Error | null, - result?: protos.google.iam.v1.ITestIamPermissionsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.testIamPermissions as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.iam.v1.TestIamPermissionsRequest', - ['resource'] - ); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('getTask', () => { - it('invokes getTask without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Task() - ); - client.innerApiCalls.getTask = stubSimpleCall(expectedResponse); - const [response] = await client.getTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Task() - ); - client.innerApiCalls.getTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTask(request), expectedError); - const actualRequest = (client.innerApiCalls.getTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTask with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.GetTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.GetTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTask(request), expectedError); - }); - }); - - describe('createTask', () => { - it('invokes createTask without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Task() - ); - client.innerApiCalls.createTask = stubSimpleCall(expectedResponse); - const [response] = await client.createTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Task() - ); - client.innerApiCalls.createTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.createTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTask with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.CreateTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.CreateTaskRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTask(request), expectedError); - }); - }); - - describe('deleteTask', () => { - it('invokes deleteTask without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTask = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTask( - 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.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTask = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteTask(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTask with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.DeleteTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.DeleteTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTask(request), expectedError); - }); - }); - - describe('runTask', () => { - it('invokes runTask without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Task() - ); - client.innerApiCalls.runTask = stubSimpleCall(expectedResponse); - const [response] = await client.runTask(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.Task() - ); - client.innerApiCalls.runTask = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runTask( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.ITask | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.runTask = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runTask(request), expectedError); - const actualRequest = (client.innerApiCalls.runTask as SinonStub).getCall( - 0 - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runTask as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runTask with closed client', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.RunTaskRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.RunTaskRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runTask(request), expectedError); - }); - }); - - describe('listQueues', () => { - it('invokes listQueues without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - ]; - client.innerApiCalls.listQueues = stubSimpleCall(expectedResponse); - const [response] = await client.listQueues(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueues without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - ]; - client.innerApiCalls.listQueues = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listQueues( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.IQueue[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueues with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listQueues = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.listQueues(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listQueues as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listQueuesStream without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - ]; - client.descriptors.page.listQueues.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listQueuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta3.Queue[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta3.Queue) => { - 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.listQueues.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listQueues, request) - ); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listQueuesStream with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listQueues.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listQueuesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta3.Queue[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta3.Queue) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listQueues, request) - ); - assert( - (client.descriptors.page.listQueues.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listQueues without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Queue()), - ]; - client.descriptors.page.listQueues.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.tasks.v2beta3.IQueue[] = []; - const iterable = client.listQueuesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listQueues.asyncIterate as SinonStub).getCall( - 0 - ).args[1], - request - ); - assert( - (client.descriptors.page.listQueues.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listQueues with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListQueuesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListQueuesRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listQueues.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listQueuesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.tasks.v2beta3.IQueue[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listQueues.asyncIterate as SinonStub).getCall( - 0 - ).args[1], - request - ); - assert( - (client.descriptors.page.listQueues.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listTasks', () => { - it('invokes listTasks without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - ]; - client.innerApiCalls.listTasks = stubSimpleCall(expectedResponse); - const [response] = await client.listTasks(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks without error using callback', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - ]; - client.innerApiCalls.listTasks = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTasks( - request, - ( - err?: Error | null, - result?: protos.google.cloud.tasks.v2beta3.ITask[] | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasks with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTasks(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listTasks as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTasksStream without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - ]; - client.descriptors.page.listTasks.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta3.Task[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta3.Task) => { - 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.listTasks.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listTasks, request) - ); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTasksStream with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listTasksStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.tasks.v2beta3.Task[] = []; - stream.on( - 'data', - (response: protos.google.cloud.tasks.v2beta3.Task) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listTasks, request) - ); - assert( - (client.descriptors.page.listTasks.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks without error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - generateSampleMessage(new protos.google.cloud.tasks.v2beta3.Task()), - ]; - client.descriptors.page.listTasks.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.tasks.v2beta3.ITask[] = []; - const iterable = client.listTasksAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTasks with error', async () => { - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.tasks.v2beta3.ListTasksRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.tasks.v2beta3.ListTasksRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listTasksAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.tasks.v2beta3.ITask[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTasks.asyncIterate as SinonStub).getCall(0) - .args[1], - request - ); - assert( - (client.descriptors.page.listTasks.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - describe('location', () => { - const fakePath = '/rendered/path/location'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - }; - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.locationPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath('projectValue', 'locationValue'); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('project', () => { - const fakePath = '/rendered/path/project'; - const expectedParameters = { - project: 'projectValue', - }; - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - 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('queue', () => { - const fakePath = '/rendered/path/queue'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - queue: 'queueValue', - }; - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.queuePathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.queuePathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('queuePath', () => { - const result = client.queuePath( - 'projectValue', - 'locationValue', - 'queueValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.queuePathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromQueueName', () => { - const result = client.matchProjectFromQueueName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromQueueName', () => { - const result = client.matchLocationFromQueueName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchQueueFromQueueName', () => { - const result = client.matchQueueFromQueueName(fakePath); - assert.strictEqual(result, 'queueValue'); - assert( - (client.pathTemplates.queuePathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - - describe('task', () => { - const fakePath = '/rendered/path/task'; - const expectedParameters = { - project: 'projectValue', - location: 'locationValue', - queue: 'queueValue', - task: 'taskValue', - }; - const client = new cloudtasksModule.v2beta3.CloudTasksClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.taskPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.taskPathTemplate.match = sinon - .stub() - .returns(expectedParameters); - - it('taskPath', () => { - const result = client.taskPath( - 'projectValue', - 'locationValue', - 'queueValue', - 'taskValue' - ); - assert.strictEqual(result, fakePath); - assert( - (client.pathTemplates.taskPathTemplate.render as SinonStub) - .getCall(-1) - .calledWith(expectedParameters) - ); - }); - - it('matchProjectFromTaskName', () => { - const result = client.matchProjectFromTaskName(fakePath); - assert.strictEqual(result, 'projectValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchLocationFromTaskName', () => { - const result = client.matchLocationFromTaskName(fakePath); - assert.strictEqual(result, 'locationValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchQueueFromTaskName', () => { - const result = client.matchQueueFromTaskName(fakePath); - assert.strictEqual(result, 'queueValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchTaskFromTaskName', () => { - const result = client.matchTaskFromTaskName(fakePath); - assert.strictEqual(result, 'taskValue'); - assert( - (client.pathTemplates.taskPathTemplate.match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - }); - }); -}); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index c78f1c88..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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/webpack.config.js b/webpack.config.js deleted file mode 100644 index 69d88cc5..00000000 --- a/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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: 'tasks', - filename: './tasks.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', -};