diff --git a/packages/google-devtools-cloudbuild/.eslintignore b/packages/google-devtools-cloudbuild/.eslintignore new file mode 100644 index 000000000000..ea5b04aebe68 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-devtools-cloudbuild/.eslintrc.json b/packages/google-devtools-cloudbuild/.eslintrc.json new file mode 100644 index 000000000000..782153495464 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-devtools-cloudbuild/.gitattributes b/packages/google-devtools-cloudbuild/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-devtools-cloudbuild/.github/.OwlBot.yaml b/packages/google-devtools-cloudbuild/.github/.OwlBot.yaml new file mode 100644 index 000000000000..0b979a333250 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.github/.OwlBot.yaml @@ -0,0 +1,25 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/devtools/cloudbuild/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: 0629d7a32eb96685272de698a1e5f31f030b60c1 + diff --git a/packages/google-devtools-cloudbuild/.gitignore b/packages/google-devtools-cloudbuild/.gitignore new file mode 100644 index 000000000000..5d32b23782f3 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-devtools-cloudbuild/.jsdoc.js b/packages/google-devtools-cloudbuild/.jsdoc.js new file mode 100644 index 000000000000..773c8c4fcc80 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/cloudbuild', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-devtools-cloudbuild/.mocharc.js b/packages/google-devtools-cloudbuild/.mocharc.js new file mode 100644 index 000000000000..0b600509bed2 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-devtools-cloudbuild/.mocharc.json b/packages/google-devtools-cloudbuild/.mocharc.json new file mode 100644 index 000000000000..670c5e2c24b7 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-devtools-cloudbuild/.nycrc b/packages/google-devtools-cloudbuild/.nycrc new file mode 100644 index 000000000000..b18d5472b62b --- /dev/null +++ b/packages/google-devtools-cloudbuild/.nycrc @@ -0,0 +1,24 @@ +{ + "report-dir": "./.coverage", + "reporter": ["text", "lcov"], + "exclude": [ + "**/*-test", + "**/.coverage", + "**/apis", + "**/benchmark", + "**/conformance", + "**/docs", + "**/samples", + "**/scripts", + "**/protos", + "**/test", + "**/*.d.ts", + ".jsdoc.js", + "**/.jsdoc.js", + "karma.conf.js", + "webpack-tests.config.js", + "webpack.config.js" + ], + "exclude-after-remap": false, + "all": true +} diff --git a/packages/google-devtools-cloudbuild/.prettierignore b/packages/google-devtools-cloudbuild/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-devtools-cloudbuild/.prettierrc.js b/packages/google-devtools-cloudbuild/.prettierrc.js new file mode 100644 index 000000000000..d1b95106f4ce --- /dev/null +++ b/packages/google-devtools-cloudbuild/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-devtools-cloudbuild/.readme-partials.yml b/packages/google-devtools-cloudbuild/.readme-partials.yml new file mode 100644 index 000000000000..bf8250ac8bfe --- /dev/null +++ b/packages/google-devtools-cloudbuild/.readme-partials.yml @@ -0,0 +1,5 @@ +body: |- + ### Using TypeScript + + `@google-cloud/cloudbuild` provides TypeScript type definitions. + diff --git a/packages/google-devtools-cloudbuild/.repo-metadata.json b/packages/google-devtools-cloudbuild/.repo-metadata.json new file mode 100644 index 000000000000..1d2c8a2419b9 --- /dev/null +++ b/packages/google-devtools-cloudbuild/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "repo": "googleapis/nodejs-cloudbuild", + "codeowner_team": "@googleapis/aap-dpes", + "requires_billing": true, + "name": "cloudbuild", + "issue_tracker": "https://issuetracker.google.com/savedsearches/5226584", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/cloudbuild/latest", + "language": "nodejs", + "release_level": "stable", + "product_documentation": "https://cloud.google.com/cloud-build/docs/", + "default_version": "v1", + "name_pretty": "Cloud Build", + "distribution_name": "@google-cloud/cloudbuild", + "api_id": "cloudbuild.googleapis.com", + "api_shortname": "cloudbuild", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-devtools-cloudbuild/CHANGELOG.md b/packages/google-devtools-cloudbuild/CHANGELOG.md new file mode 100644 index 000000000000..bd232199c639 --- /dev/null +++ b/packages/google-devtools-cloudbuild/CHANGELOG.md @@ -0,0 +1,329 @@ +# Changelog + +## [3.2.0](https://github.com/googleapis/nodejs-cloudbuild/compare/v3.1.2...v3.2.0) (2022-11-11) + + +### Features + +* Add allow_failure, exit_code, and allow_exit_code to BuildStep message ([84c7dd7](https://github.com/googleapis/nodejs-cloudbuild/commit/84c7dd75501fea0d9c351904d40f4abd99e51e1a)) +* Integration of Cloud Build with Artifact Registry ([#352](https://github.com/googleapis/nodejs-cloudbuild/issues/352)) ([84c7dd7](https://github.com/googleapis/nodejs-cloudbuild/commit/84c7dd75501fea0d9c351904d40f4abd99e51e1a)) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#354](https://github.com/googleapis/nodejs-cloudbuild/issues/354)) ([9570dc0](https://github.com/googleapis/nodejs-cloudbuild/commit/9570dc04db9e1722052c5515bd616ddf87d569a5)) +* Regenerated protos JS and TS definitions ([#358](https://github.com/googleapis/nodejs-cloudbuild/issues/358)) ([1e7a054](https://github.com/googleapis/nodejs-cloudbuild/commit/1e7a0540a78383c7dfd2b957e282a21dea1fc02c)) + +## [3.1.2](https://github.com/googleapis/nodejs-cloudbuild/compare/v3.1.1...v3.1.2) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#344](https://github.com/googleapis/nodejs-cloudbuild/issues/344)) ([004810d](https://github.com/googleapis/nodejs-cloudbuild/commit/004810d748249c000e8df308b70c03097e65fc25)) + +## [3.1.1](https://github.com/googleapis/nodejs-cloudbuild/compare/v3.1.0...v3.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#343](https://github.com/googleapis/nodejs-cloudbuild/issues/343)) ([4828f1e](https://github.com/googleapis/nodejs-cloudbuild/commit/4828f1e49b530f19d4d25fcc797b9ffe90c7d4ff)) +* Better support for fallback mode ([#337](https://github.com/googleapis/nodejs-cloudbuild/issues/337)) ([909b6c8](https://github.com/googleapis/nodejs-cloudbuild/commit/909b6c8c5f34eeda975f2f818725b9ece202e60d)) +* Change import long to require ([#339](https://github.com/googleapis/nodejs-cloudbuild/issues/339)) ([c1cdde2](https://github.com/googleapis/nodejs-cloudbuild/commit/c1cdde2c692c107414a461620c7e0634b7fc957f)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-cloudbuild/issues/1553)) ([#342](https://github.com/googleapis/nodejs-cloudbuild/issues/342)) ([80cda93](https://github.com/googleapis/nodejs-cloudbuild/commit/80cda938f92ae85266d2468dbb51856fb1d33579)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-cloudbuild/issues/1546)) ([#341](https://github.com/googleapis/nodejs-cloudbuild/issues/341)) ([f5133f8](https://github.com/googleapis/nodejs-cloudbuild/commit/f5133f8a4e5411a452583b0541c60b09124152be)) + +## [3.1.0](https://github.com/googleapis/nodejs-cloudbuild/compare/v3.0.1...v3.1.0) (2022-07-04) + + +### Features + +* support regapic LRO ([d769170](https://github.com/googleapis/nodejs-cloudbuild/commit/d7691703d9948ddfec8f253f9569e7b603f40ce8)) +* support regapic LRO ([#333](https://github.com/googleapis/nodejs-cloudbuild/issues/333)) ([eb65473](https://github.com/googleapis/nodejs-cloudbuild/commit/eb65473efeedf235a28de62e352db78d5d038e25)) + +## [3.0.1](https://github.com/googleapis/nodejs-cloudbuild/compare/v3.0.0...v3.0.1) (2022-06-20) + + +### Bug Fixes + +* fixes for dynamic routing and streaming descriptors ([#327](https://github.com/googleapis/nodejs-cloudbuild/issues/327)) ([4cf9b63](https://github.com/googleapis/nodejs-cloudbuild/commit/4cf9b6342121cdff09767321ab3a24d56f7f13d9)) + +## [3.0.0](https://github.com/googleapis/nodejs-cloudbuild/compare/v2.6.0...v3.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#325) + +### Build System + +* update library to use Node 12 ([#325](https://github.com/googleapis/nodejs-cloudbuild/issues/325)) ([596e5c2](https://github.com/googleapis/nodejs-cloudbuild/commit/596e5c21bc21c1d74fecb4cb7eb887561e1598f8)) + +## [2.6.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.5.0...v2.6.0) (2021-08-25) + + +### Features + +* add script field to BuildStep message ([#273](https://www.github.com/googleapis/nodejs-cloudbuild/issues/273)) ([b91fb68](https://www.github.com/googleapis/nodejs-cloudbuild/commit/b91fb68748dbc0ddafde776eaaf81f211102a3b2)) +* Update cloudbuild proto with the service_account for BYOSA Triggers. ([#274](https://www.github.com/googleapis/nodejs-cloudbuild/issues/274)) ([0ad4f9b](https://www.github.com/googleapis/nodejs-cloudbuild/commit/0ad4f9b9646a66ab6a5a91ddbbf7c8644c17317c)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.4.0...v2.5.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#271](https://www.github.com/googleapis/nodejs-cloudbuild/issues/271)) ([dcb970d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/dcb970d8a6a7d87da553667cd25f8eb1052ba047)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.3.2...v2.4.0) (2021-08-16) + + +### Features + +* Add ability to configure BuildTriggers to create Builds that require approval before executing and ApproveBuild API to approve or reject pending Builds ([#267](https://www.github.com/googleapis/nodejs-cloudbuild/issues/267)) ([18ec067](https://www.github.com/googleapis/nodejs-cloudbuild/commit/18ec067ac1e112836c5d56747dda89e04f87c481)) + +### [2.3.2](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.3.1...v2.3.2) (2021-08-16) + + +### Bug Fixes + +* **deps:** google-gax v2.24.1 ([#268](https://www.github.com/googleapis/nodejs-cloudbuild/issues/268)) ([c26f7f7](https://www.github.com/googleapis/nodejs-cloudbuild/commit/c26f7f726db4f43f3692aea4c516547abcddd0ea)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.3.0...v2.3.1) (2021-08-12) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#265](https://www.github.com/googleapis/nodejs-cloudbuild/issues/265)) ([e89f829](https://www.github.com/googleapis/nodejs-cloudbuild/commit/e89f829f10c5710ca5fb259a6c8dfae1527071a3)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.7...v2.3.0) (2021-08-05) + + +### ⚠ BREAKING CHANGES + +* * feat: add a WorkerPools API + +### Features + +* add a WorkerPools API ([#254](https://www.github.com/googleapis/nodejs-cloudbuild/issues/254)) ([2e5b3f5](https://www.github.com/googleapis/nodejs-cloudbuild/commit/2e5b3f540d9cd2b3a616c4581b07ebcfc444e7c7)) +* Implementation of Build Failure Info: - Added message FailureInfo field ([#255](https://www.github.com/googleapis/nodejs-cloudbuild/issues/255)) ([6f115e2](https://www.github.com/googleapis/nodejs-cloudbuild/commit/6f115e2a4ec78289014c05f398d8464e599b1ef6)) + + +### Build System + +* force a minor release ([#262](https://www.github.com/googleapis/nodejs-cloudbuild/issues/262)) ([bc43706](https://www.github.com/googleapis/nodejs-cloudbuild/commit/bc4370692e233c265ce45546b205b9b9925d3990)) + +### [2.2.7](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.6...v2.2.7) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#251](https://www.github.com/googleapis/nodejs-cloudbuild/issues/251)) ([7bc5f7f](https://www.github.com/googleapis/nodejs-cloudbuild/commit/7bc5f7ff6c1485baaf1444a608d8ebb88ad20cfe)) + +### [2.2.6](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.5...v2.2.6) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#249](https://www.github.com/googleapis/nodejs-cloudbuild/issues/249)) ([e53360f](https://www.github.com/googleapis/nodejs-cloudbuild/commit/e53360f645d0b9e584261acffbd001efd2d2081a)) + +### [2.2.5](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.4...v2.2.5) (2021-07-01) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#245](https://www.github.com/googleapis/nodejs-cloudbuild/issues/245)) ([2fbba81](https://www.github.com/googleapis/nodejs-cloudbuild/commit/2fbba81b99e000ff104b76e20f0c37f3f9ea585d)) + +### [2.2.4](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.3...v2.2.4) (2021-06-24) + + +### Bug Fixes + +* make request optional in all cases ([#241](https://www.github.com/googleapis/nodejs-cloudbuild/issues/241)) ([c96003a](https://www.github.com/googleapis/nodejs-cloudbuild/commit/c96003a4897d3f7c8181a56c273b842a4dcdfbf7)) + +### [2.2.3](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.2...v2.2.3) (2021-05-25) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#231](https://www.github.com/googleapis/nodejs-cloudbuild/issues/231)) ([d6bd0be](https://www.github.com/googleapis/nodejs-cloudbuild/commit/d6bd0bee152c1c9864b8d6f09ab473309a576b50)) + +### [2.2.2](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.1...v2.2.2) (2021-05-12) + + +### Bug Fixes + +* use require() to load JSON protos ([#225](https://www.github.com/googleapis/nodejs-cloudbuild/issues/225)) ([1d9fc28](https://www.github.com/googleapis/nodejs-cloudbuild/commit/1d9fc28d5b2a18305a44a2b315a5f8ccd2cf4da7)) + +### [2.2.1](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.0...v2.2.1) (2021-05-07) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#219](https://www.github.com/googleapis/nodejs-cloudbuild/issues/219)) ([2d5e809](https://www.github.com/googleapis/nodejs-cloudbuild/commit/2d5e8091d4c2f99739ebd2f849eb5c30e3956952)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.1.0...v2.2.0) (2021-04-16) + + +### Features + +* Add fields for Pub/Sub triggers ([#211](https://www.github.com/googleapis/nodejs-cloudbuild/issues/211)) ([0cbc740](https://www.github.com/googleapis/nodejs-cloudbuild/commit/0cbc740e7306388104a5a71c412732ac1c097528)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.6...v2.1.0) (2021-04-01) + + +### Features + +* Add `COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY` for corresponding comment control feat: Committer: [@lozord](https://www.github.com/lozord) ([48fe15d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/48fe15d49504bbb77078984154a147840c484825)) +* Add `ReceiveTriggerWebhook` for webhooks activating specific triggers. ([48fe15d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/48fe15d49504bbb77078984154a147840c484825)) +* Add `SecretManager`-related resources and messages for corresponding integration. ([48fe15d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/48fe15d49504bbb77078984154a147840c484825)) + + +### Bug Fixes + +* Specify `build` as the body of a `CreateBuild` call. The Cloud Build API has always assumed this, but now we are actually specifying it. ([#202](https://www.github.com/googleapis/nodejs-cloudbuild/issues/202)) ([48fe15d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/48fe15d49504bbb77078984154a147840c484825)) + +### [2.0.6](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.5...v2.0.6) (2020-11-25) + + +### Bug Fixes + +* check for fetch on window ([#185](https://www.github.com/googleapis/nodejs-cloudbuild/issues/185)) ([115de71](https://www.github.com/googleapis/nodejs-cloudbuild/commit/115de7141262c119113759aee5ddc141d129b55d)) + +### [2.0.5](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.4...v2.0.5) (2020-11-06) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#181](https://www.github.com/googleapis/nodejs-cloudbuild/issues/181)) ([c1a8c19](https://www.github.com/googleapis/nodejs-cloudbuild/commit/c1a8c1948441cbc4643692f039c5a4ddbd178162)) + +### [2.0.4](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.3...v2.0.4) (2020-11-03) + + +### ⚠ BREAKING CHANGES + +* The WorkerPool API in the v1 surface has been long deprecated, so it has been deleted from the v1 surface. Alpha WorkerPool customers who want to call the WorkerPool API can use gcloud. + +### Features + +* updated third_party Cloud Build clients with new Build message, fix: revert removal of WorkerPool API ([#166](https://www.github.com/googleapis/nodejs-cloudbuild/issues/166)) ([b8d7a39](https://www.github.com/googleapis/nodejs-cloudbuild/commit/b8d7a395bbcc2f6ff83b798ef678e2f27395802d)) + + +### Bug Fixes + +* revert removal of WorkerPool API ([#178](https://www.github.com/googleapis/nodejs-cloudbuild/issues/178)) ([07400cb](https://www.github.com/googleapis/nodejs-cloudbuild/commit/07400cbcb05808762ab3c56c5827607cdefd43c0)) + +### [2.0.3](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.2...v2.0.3) (2020-07-24) + + +### Bug Fixes + +* add missing cloudbuild RPCs to retry config, add Node 8 tests  ([#141](https://www.github.com/googleapis/nodejs-cloudbuild/issues/141)) ([e4b83e8](https://www.github.com/googleapis/nodejs-cloudbuild/commit/e4b83e8a63f6ddba2ea158ab0ed9b4a50fa536bf)) +* inline markup spans must be separated from the surrounding text by non-word characters ([#146](https://www.github.com/googleapis/nodejs-cloudbuild/issues/146)) ([52b4770](https://www.github.com/googleapis/nodejs-cloudbuild/commit/52b4770f0c262ce91306e31d68f3b47b0598751d)) + +### [2.0.2](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.1...v2.0.2) (2020-07-09) + + +### Bug Fixes + +* typeo in nodejs .gitattribute ([#132](https://www.github.com/googleapis/nodejs-cloudbuild/issues/132)) ([80b5bd9](https://www.github.com/googleapis/nodejs-cloudbuild/commit/80b5bd963aa43e5a47da9e6d0e2ffbf0cde7feef)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.0.0...v2.0.1) (2020-07-06) + + +### Bug Fixes + +* support fallback mode for electron ([#124](https://www.github.com/googleapis/nodejs-cloudbuild/issues/124)) ([d2c9f9b](https://www.github.com/googleapis/nodejs-cloudbuild/commit/d2c9f9b69463f9739b1813c673ba53ee97c9a3d5)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.5.0...v2.0.0) (2020-06-11) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* add time-to-live in a queue for builds ([04e3387](https://www.github.com/googleapis/nodejs-cloudbuild/commit/04e3387af33a7ab39eb0c4df47ce08026507b499)) +* check status of long running operation by its name ([#114](https://www.github.com/googleapis/nodejs-cloudbuild/issues/114)) ([7b50a74](https://www.github.com/googleapis/nodejs-cloudbuild/commit/7b50a74c098e782393f92140a37e3bd26f45e77d)) +* drop node8 support, support for async iterators ([#91](https://www.github.com/googleapis/nodejs-cloudbuild/issues/91)) ([74a195d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/74a195d5cdf63dab1ac3d0d52ef42e1254ab3a2e)) +* improve support for x-goog-request-params ([#111](https://www.github.com/googleapis/nodejs-cloudbuild/issues/111)) ([e08d640](https://www.github.com/googleapis/nodejs-cloudbuild/commit/e08d64017e059c911ebe55055c26a0ab76481d86)) +* move ts target to es2018 from es2016 ([#121](https://www.github.com/googleapis/nodejs-cloudbuild/issues/121)) ([59c5477](https://www.github.com/googleapis/nodejs-cloudbuild/commit/59c547744519ef9e8d073ea3ecdb81248176a71a)) + + +### Bug Fixes + +* remove eslint, update gax, fix generated protos, run the generator ([#100](https://www.github.com/googleapis/nodejs-cloudbuild/issues/100)) ([aafb9cc](https://www.github.com/googleapis/nodejs-cloudbuild/commit/aafb9cc7745b4d5d6dce58f17763f76379af733f)) +* synth.py clean up for multiple version ([#115](https://www.github.com/googleapis/nodejs-cloudbuild/issues/115)) ([aa7d99b](https://www.github.com/googleapis/nodejs-cloudbuild/commit/aa7d99b9c02267808cac07f7691f5ce62f06ca14)) + +## [1.5.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.4.0...v1.5.0) (2020-03-09) + + +### Features + +* cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields. ([#79](https://www.github.com/googleapis/nodejs-cloudbuild/issues/79)) ([0889fff](https://www.github.com/googleapis/nodejs-cloudbuild/commit/0889fff058e83dd421d4ad798c0f5318d74f22ff)) +* deferred client initialization ([#75](https://www.github.com/googleapis/nodejs-cloudbuild/issues/75)) ([47b177d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/47b177dfed997bf4fafcf2810ddae9c5c7815112)) +* export protos in src/index.ts ([c8e28b3](https://www.github.com/googleapis/nodejs-cloudbuild/commit/c8e28b3f39fa25e09ebaf19292a46b9078738498)) + +## [1.4.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.3.3...v1.4.0) (2020-02-13) + + +### Features + +* bump release level to GA ([#62](https://www.github.com/googleapis/nodejs-cloudbuild/issues/62)) ([114756d](https://www.github.com/googleapis/nodejs-cloudbuild/commit/114756d12007d1978fc3e4bb71b72e543bcc6945)) + +### [1.3.3](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.3.2...v1.3.3) (2020-02-10) + + +### Bug Fixes + +* pass x-goog-request-params header for streaming calls ([365842b](https://www.github.com/googleapis/nodejs-cloudbuild/commit/365842beb7e0ceee9f5861d4172f5de076335902)) + +### [1.3.2](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.3.1...v1.3.2) (2020-01-28) + + +### Bug Fixes + +* enum, bytes, and Long types now accept strings ([64538fe](https://www.github.com/googleapis/nodejs-cloudbuild/commit/64538fe21aae6430f8f3e1ec6604b286bd890535)) + +### [1.3.1](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.3.0...v1.3.1) (2020-01-06) + + +### Bug Fixes + +* increase timeout from 20s to 60s ([#35](https://www.github.com/googleapis/nodejs-cloudbuild/issues/35)) ([b9d7f10](https://www.github.com/googleapis/nodejs-cloudbuild/commit/b9d7f1089bd3dc0f3d53f54015b12bd2bf036c62)) +* wait for client before checking for terminate ([35c1905](https://www.github.com/googleapis/nodejs-cloudbuild/commit/35c19050bd7594301df14ffa182fc6e6e73c1d64)) + +## [1.3.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.2.0...v1.3.0) (2019-12-11) + + +### Features + +* make operationsClient and service stub public ([2fa96df](https://www.github.com/googleapis/nodejs-cloudbuild/commit/2fa96dfe9145f479a2561b5a1215a6ffd19ddf07)) + +## [1.2.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.1.0...v1.2.0) (2019-12-05) + + +### Features + +* add default exports ([#22](https://www.github.com/googleapis/nodejs-cloudbuild/issues/22)) ([870bfd6](https://www.github.com/googleapis/nodejs-cloudbuild/commit/870bfd649e99f0332b04b51eddfce27ab5078cf5)) + + +### Bug Fixes + +* **deps:** pin TypeScript below 3.7.0 ([c8d7267](https://www.github.com/googleapis/nodejs-cloudbuild/commit/c8d72671a810750d13d327e78b0eafbd0aeac46f)) +* **docs:** snippets are now replaced in jsdoc comments ([#21](https://www.github.com/googleapis/nodejs-cloudbuild/issues/21)) ([b6bf159](https://www.github.com/googleapis/nodejs-cloudbuild/commit/b6bf159e7d3799121b58fe8b290181c16b6aa894)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v1.0.0...v1.1.0) (2019-11-11) + + +### Features + +* adds listBuildTriggersStream method ([59dad8a](https://www.github.com/googleapis/nodejs-cloudbuild/commit/59dad8afb351527cd7fd3348921ce30e4cd1956b)) + +## 1.0.0 (2019-10-31) + + +### Features + +* initial release of cloud build library ([#2](https://www.github.com/googleapis/nodejs-cloudbuild/issues/2)) ([b3dbed2](https://www.github.com/googleapis/nodejs-cloudbuild/commit/b3dbed28a63e88f09bcaf7bfa2984582ef058fb6)) +* **docs:** add listBuildTriggers sample to README ([#5](https://www.github.com/googleapis/nodejs-cloudbuild/issues/5)) ([adcdb63](https://www.github.com/googleapis/nodejs-cloudbuild/commit/adcdb632244ddf18c1b57a1b0bdef1dcef3ae14b)) +* moves library to TypeScript code generation ([#10](https://www.github.com/googleapis/nodejs-cloudbuild/issues/10)) ([871fa08](https://www.github.com/googleapis/nodejs-cloudbuild/commit/871fa0814d9483fdfa0081fad409c535ce25cac1)) diff --git a/packages/google-devtools-cloudbuild/CODE_OF_CONDUCT.md b/packages/google-devtools-cloudbuild/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/packages/google-devtools-cloudbuild/CODE_OF_CONDUCT.md @@ -0,0 +1,94 @@ + +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +Reports should be directed to *googleapis-stewards@google.com*, the +Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to +receive and address reported violations of the code of conduct. They will then +work with a committee consisting of representatives from the Open Source +Programs Office and the Google Open Source Strategy team. If for any reason you +are uncomfortable reaching out to the Project Steward, please email +opensource@google.com. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/packages/google-devtools-cloudbuild/CONTRIBUTING.md b/packages/google-devtools-cloudbuild/CONTRIBUTING.md new file mode 100644 index 000000000000..8d259c5b9295 --- /dev/null +++ b/packages/google-devtools-cloudbuild/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Build API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + + +## Running the tests + +1. [Prepare your environment for Node.js setup][setup]. + +1. Install dependencies: + + npm install + +1. Run the tests: + + # Run unit tests. + npm test + + # Run sample integration tests. + npm run samples-test + + # Run all system tests. + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-devtools-cloudbuild/LICENSE b/packages/google-devtools-cloudbuild/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/packages/google-devtools-cloudbuild/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/google-devtools-cloudbuild/README.md b/packages/google-devtools-cloudbuild/README.md new file mode 100644 index 000000000000..b1d33f831e8e --- /dev/null +++ b/packages/google-devtools-cloudbuild/README.md @@ -0,0 +1,188 @@ +[//]: # "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 Build: Node.js Client](https://github.com/googleapis/nodejs-cloudbuild) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/cloudbuild.svg)](https://www.npmjs.org/package/@google-cloud/cloudbuild) + + + + +Cloud Build API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-cloudbuild/blob/main/CHANGELOG.md). + +* [Cloud Build Node.js Client API Reference][client-docs] +* [Cloud Build Documentation][product-docs] +* [github.com/googleapis/nodejs-cloudbuild](https://github.com/googleapis/nodejs-cloudbuild) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Build API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/cloudbuild +``` + + +### Using the client library + +```javascript +async function quickstart( + projectId = 'YOUR_PROJECT_ID', // Your Google Cloud Platform project ID + triggerId = 'YOUR_TRIGGER_ID', // UUID for build trigger. + branchName = 'BRANCH_TO_BUILD' // Branch to run build against. +) { + // Imports the Google Cloud client library + const {CloudBuildClient} = require('@google-cloud/cloudbuild'); + + // Creates a client + const cb = new CloudBuildClient(); + + // Note: for Private Pools, you'll have to specify an API endpoint value + // For example: + // const cb = new CloudBuildClient({ apiEndpoint: '-cloudbuild.googleapis.com' }); + + // Starts a build against the branch provided. + const [resp] = await cb.runBuildTrigger({ + projectId, + triggerId, + source: { + projectId, + dir: './', + branchName, + }, + }); + console.info(`triggered build for ${triggerId}`); + const [build] = await resp.promise(); + + const STATUS_LOOKUP = [ + 'UNKNOWN', + 'Queued', + 'Working', + 'Success', + 'Failure', + 'Error', + 'Timeout', + 'Cancelled', + ]; + for (const step of build.steps) { + console.info( + `step:\n\tname: ${step.name}\n\tstatus: ${STATUS_LOOKUP[build.status]}` + ); + } +} + +``` +### Using TypeScript + +`@google-cloud/cloudbuild` provides TypeScript type definitions. + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-cloudbuild/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| List Triggers. | [source code](https://github.com/googleapis/nodejs-cloudbuild/blob/main/samples/listBuildTriggers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-cloudbuild&page=editor&open_in_editor=samples/listBuildTriggers.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-cloudbuild/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-cloudbuild&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | + + + +The [Cloud Build Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +Libraries are compatible with all current _active_ and _maintenance_ versions of +Node.js. +If you are using an end-of-life version of Node.js, we recommend that you update +as soon as possible to an actively supported LTS version. + +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: + +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. +For example, `npm install @google-cloud/cloudbuild@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-cloudbuild/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-cloudbuild/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/cloudbuild/latest +[product-docs]: https://cloud.google.com/cloud-build/docs/ +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[projects]: https://console.cloud.google.com/project +[billing]: https://support.google.com/cloud/answer/6293499#enable-billing +[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-devtools-cloudbuild/cloudbuild.yaml b/packages/google-devtools-cloudbuild/cloudbuild.yaml new file mode 100644 index 000000000000..6a5515e42ef6 --- /dev/null +++ b/packages/google-devtools-cloudbuild/cloudbuild.yaml @@ -0,0 +1,7 @@ +steps: +- name: node:19 + entrypoint: npm + args: ['install'] +- name: node:19 + entrypoint: npm + args: ['test'] diff --git a/packages/google-devtools-cloudbuild/linkinator.config.json b/packages/google-devtools-cloudbuild/linkinator.config.json new file mode 100644 index 000000000000..befd23c86335 --- /dev/null +++ b/packages/google-devtools-cloudbuild/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-devtools-cloudbuild/package.json b/packages/google-devtools-cloudbuild/package.json new file mode 100644 index 000000000000..a7a3e0b02fec --- /dev/null +++ b/packages/google-devtools-cloudbuild/package.json @@ -0,0 +1,66 @@ +{ + "repository": "googleapis/nodejs-cloudbuild", + "name": "@google-cloud/cloudbuild", + "version": "3.2.0", + "author": "Google LLC", + "description": "Cloud Build API client for Node.js", + "main": "build/src/index.js", + "browser": "src/browser.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google cloudbuild", + "cloudbuild", + "Cloud Build API" + ], + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "chai": "^4.2.0", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "typescript": "^4.6.4" + }, + "scripts": { + "predocs": "npm run compile", + "docs": "jsdoc -c .jsdoc.js", + "lint": "gts check", + "clean": "gts clean", + "fix": "gts fix", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "prepare": "npm run compile-protos && npm run compile", + "pretest": "npm run compile", + "test": "c8 mocha build/test", + "system-test": "c8 mocha --timeout=15000 system-test/*.js build/system-test/*.js", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "google-gax": "^3.5.2" + } +} diff --git a/packages/google-devtools-cloudbuild/proto.list b/packages/google-devtools-cloudbuild/proto.list new file mode 100644 index 000000000000..21b93f487118 --- /dev/null +++ b/packages/google-devtools-cloudbuild/proto.list @@ -0,0 +1,12 @@ +google/api/http.proto +google/protobuf/descriptor.proto +google/api/annotations.proto +google/api/client.proto +google/api/field_behavior.proto +google/protobuf/any.proto +google/protobuf/empty.proto +google/rpc/status.proto +google/longrunning/operations.proto +google/protobuf/duration.proto +google/protobuf/timestamp.proto +google/devtools/cloudbuild/v1/cloudbuild.proto diff --git a/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto b/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto new file mode 100644 index 000000000000..c007e65b4411 --- /dev/null +++ b/packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -0,0 +1,2253 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.devtools.cloudbuild.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudBuild.V1"; +option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild"; +option java_multiple_files = true; +option java_package = "com.google.cloudbuild.v1"; +option objc_class_prefix = "GCB"; +option ruby_package = "Google::Cloud::Build::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/ServiceAccount" + pattern: "projects/{project}/serviceAccounts/{service_account}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/Secret" + pattern: "projects/{project}/secrets/{secret}" +}; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Subscription" + pattern: "projects/{project}/subscriptions/{subscription}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Creates and manages builds on Google Cloud Platform. +// +// The main concept used by this API is a `Build`, which describes the location +// of the source to build, how to build the source, and where to store the +// built artifacts, if any. +// +// A user can list previously-requested builds or get builds by their ID to +// determine the status of the build. +service CloudBuild { + option (google.api.default_host) = "cloudbuild.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Starts a build with the specified configuration. + // + // This method returns a long-running `Operation`, which includes the build + // ID. Pass the build ID to `GetBuild` to determine the build status (such as + // `SUCCESS` or `FAILURE`). + rpc CreateBuild(CreateBuildRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/builds" + body: "build" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*}/builds" + body: "build" + } + }; + option (google.api.method_signature) = "project_id,build"; + option (google.longrunning.operation_info) = { + response_type: "Build" + metadata_type: "BuildOperationMetadata" + }; + } + + // Returns information about a previously requested build. + // + // The `Build` that is returned includes its status (such as `SUCCESS`, + // `FAILURE`, or `WORKING`), and timing information. + rpc GetBuild(GetBuildRequest) returns (Build) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/builds/{id}" + additional_bindings { get: "/v1/{name=projects/*/locations/*/builds/*}" } + }; + option (google.api.method_signature) = "project_id,id"; + } + + // Lists previously requested builds. + // + // Previously requested builds may still be in-progress, or may have finished + // successfully or unsuccessfully. + rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/builds" + additional_bindings { get: "/v1/{parent=projects/*/locations/*}/builds" } + }; + option (google.api.method_signature) = "project_id,filter"; + } + + // Cancels a build in progress. + rpc CancelBuild(CancelBuildRequest) returns (Build) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/builds/{id}:cancel" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/builds/*}:cancel" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,id"; + } + + // Creates a new build based on the specified build. + // + // This method creates a new build using the original build request, which may + // or may not result in an identical build. + // + // For triggered builds: + // + // * Triggered builds resolve to a precise revision; therefore a retry of a + // triggered build will result in a build that uses the same revision. + // + // For non-triggered builds that specify `RepoSource`: + // + // * If the original build built from the tip of a branch, the retried build + // will build from the tip of that branch, which may not be the same revision + // as the original build. + // * If the original build specified a commit sha or revision ID, the retried + // build will use the identical source. + // + // For builds that specify `StorageSource`: + // + // * If the original build pulled source from Google Cloud Storage without + // specifying the generation of the object, the new build will use the current + // object, which may be different from the original build source. + // * If the original build pulled source from Cloud Storage and specified the + // generation of the object, the new build will attempt to use the same + // object, which may or may not be available depending on the bucket's + // lifecycle management settings. + rpc RetryBuild(RetryBuildRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/builds/{id}:retry" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/builds/*}:retry" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,id"; + option (google.longrunning.operation_info) = { + response_type: "Build" + metadata_type: "BuildOperationMetadata" + }; + } + + // Approves or rejects a pending build. + // + // If approved, the returned LRO will be analogous to the LRO returned from + // a CreateBuild call. + // + // If rejected, the returned LRO will be immediately done. + rpc ApproveBuild(ApproveBuildRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/builds/*}:approve" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/builds/*}:approve" + body: "*" + } + }; + option (google.api.method_signature) = "name,approval_result"; + option (google.longrunning.operation_info) = { + response_type: "Build" + metadata_type: "BuildOperationMetadata" + }; + } + + // Creates a new `BuildTrigger`. + // + // This API is experimental. + rpc CreateBuildTrigger(CreateBuildTriggerRequest) returns (BuildTrigger) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/triggers" + body: "trigger" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*}/triggers" + body: "trigger" + } + }; + option (google.api.method_signature) = "project_id,trigger"; + } + + // Returns information about a `BuildTrigger`. + // + // This API is experimental. + rpc GetBuildTrigger(GetBuildTriggerRequest) returns (BuildTrigger) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/triggers/{trigger_id}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/triggers/*}" + } + }; + option (google.api.method_signature) = "project_id,trigger_id"; + } + + // Lists existing `BuildTrigger`s. + // + // This API is experimental. + rpc ListBuildTriggers(ListBuildTriggersRequest) + returns (ListBuildTriggersResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/triggers" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*}/triggers" + } + }; + option (google.api.method_signature) = "project_id"; + } + + // Deletes a `BuildTrigger` by its project ID and trigger ID. + // + // This API is experimental. + rpc DeleteBuildTrigger(DeleteBuildTriggerRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/projects/{project_id}/triggers/{trigger_id}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/triggers/*}" + } + }; + option (google.api.method_signature) = "project_id,trigger_id"; + } + + // Updates a `BuildTrigger` by its project ID and trigger ID. + // + // This API is experimental. + rpc UpdateBuildTrigger(UpdateBuildTriggerRequest) returns (BuildTrigger) { + option (google.api.http) = { + patch: "/v1/projects/{project_id}/triggers/{trigger_id}" + body: "trigger" + additional_bindings { + patch: "/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}" + body: "trigger" + } + }; + option (google.api.method_signature) = "project_id,trigger_id,trigger"; + } + + // Runs a `BuildTrigger` at a particular source revision. + rpc RunBuildTrigger(RunBuildTriggerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/triggers/{trigger_id}:run" + body: "source" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/triggers/*}:run" + body: "*" + } + }; + option (google.api.method_signature) = "project_id,trigger_id,source"; + option (google.longrunning.operation_info) = { + response_type: "Build" + metadata_type: "BuildOperationMetadata" + }; + } + + // ReceiveTriggerWebhook [Experimental] is called when the API receives a + // webhook request targeted at a specific trigger. + rpc ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest) + returns (ReceiveTriggerWebhookResponse) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/triggers/{trigger}:webhook" + body: "body" + additional_bindings { + post: "/v1/{name=projects/*/locations/*/triggers/*}:webhook" + body: "body" + } + }; + } + + // Creates a `WorkerPool`. + rpc CreateWorkerPool(CreateWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/workerPools" + body: "worker_pool" + }; + option (google.api.method_signature) = "parent,worker_pool,worker_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "CreateWorkerPoolOperationMetadata" + }; + } + + // Returns details of a `WorkerPool`. + rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workerPools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes a `WorkerPool`. + rpc DeleteWorkerPool(DeleteWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workerPools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteWorkerPoolOperationMetadata" + }; + } + + // Updates a `WorkerPool`. + rpc UpdateWorkerPool(UpdateWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}" + body: "worker_pool" + }; + option (google.api.method_signature) = "worker_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "UpdateWorkerPoolOperationMetadata" + }; + } + + // Lists `WorkerPool`s. + rpc ListWorkerPools(ListWorkerPoolsRequest) + returns (ListWorkerPoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/workerPools" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Specifies a build to retry. +message RetryBuildRequest { + // The name of the `Build` to retry. + // Format: `projects/{project}/locations/{location}/builds/{build}` + string name = 3 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + }]; + + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Build ID of the original build. + string id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies a build trigger to run and the source to use. +message RunBuildTriggerRequest { + // The name of the `Trigger` to run. + // Format: `projects/{project}/locations/{location}/triggers/{trigger}` + string name = 4 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/BuildTrigger" + }]; + + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the trigger. + string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Source to build against this trigger. + RepoSource source = 3; +} + +// Location of the source in an archive file in Google Cloud Storage. +message StorageSource { + // Google Cloud Storage bucket containing the source (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + string bucket = 1; + + // Google Cloud Storage object containing the source. + // + // This object must be a gzipped archive file (`.tar.gz`) containing source to + // build. + string object = 2; + + // Google Cloud Storage generation for the object. If the generation is + // omitted, the latest generation will be used. + int64 generation = 3; +} + +// Location of the source in a Google Cloud Source Repository. +message RepoSource { + // ID of the project that owns the Cloud Source Repository. If omitted, the + // project ID requesting the build is assumed. + string project_id = 1; + + // Name of the Cloud Source Repository. + string repo_name = 2; + + // A revision within the Cloud Source Repository must be specified in + // one of these ways. + oneof revision { + // Regex matching branches to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string branch_name = 3; + + // Regex matching tags to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string tag_name = 4; + + // Explicit commit SHA to build. + string commit_sha = 5; + } + + // Directory, relative to the source root, in which to run the build. + // + // This must be a relative path. If a step's `dir` is specified and is an + // absolute path, this value is ignored for that step's execution. + string dir = 7; + + // Only trigger a build if the revision regex does NOT match the revision + // regex. + bool invert_regex = 8; + + // Substitutions to use in a triggered build. + // Should only be used with RunBuildTrigger + map substitutions = 9; +} + +// Location of the source manifest in Google Cloud Storage. +// This feature is in Preview; see description +// [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). +message StorageSourceManifest { + // Google Cloud Storage bucket containing the source manifest (see [Bucket + // Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + string bucket = 1; + + // Google Cloud Storage object containing the source manifest. + // + // This object must be a JSON file. + string object = 2; + + // Google Cloud Storage generation for the object. If the generation is + // omitted, the latest generation will be used. + int64 generation = 3; +} + +// Location of the source in a supported storage service. +message Source { + // Location of source. + oneof source { + // If provided, get the source from this location in Google Cloud Storage. + StorageSource storage_source = 2; + + // If provided, get the source from this location in a Cloud Source + // Repository. + RepoSource repo_source = 3; + + // If provided, get the source from this manifest in Google Cloud Storage. + // This feature is in Preview; see description + // [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). + StorageSourceManifest storage_source_manifest = 8; + } +} + +// An image built by the pipeline. +message BuiltImage { + // Name used to push the container image to Google Container Registry, as + // presented to `docker push`. + string name = 1; + + // Docker Registry 2.0 digest. + string digest = 3; + + // Output only. Stores timing information for pushing the specified image. + TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Artifact uploaded using the PythonPackage directive. +message UploadedPythonPackage { + // URI of the uploaded artifact. + string uri = 1; + + // Hash types and values of the Python Artifact. + FileHashes file_hashes = 2; + + // Output only. Stores timing information for pushing the specified artifact. + TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A Maven artifact uploaded using the MavenArtifact directive. +message UploadedMavenArtifact { + // URI of the uploaded artifact. + string uri = 1; + + // Hash types and values of the Maven Artifact. + FileHashes file_hashes = 2; + + // Output only. Stores timing information for pushing the specified artifact. + TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A step in the build pipeline. +message BuildStep { + // Required. The name of the container image that will run this particular + // build step. + // + // If the image is available in the host's Docker daemon's cache, it + // will be run directly. If not, the host will attempt to pull the image + // first, using the builder service account's credentials if necessary. + // + // The Docker daemon's cache will already have the latest versions of all of + // the officially supported build steps + // ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). + // The Docker daemon will also have cached many of the layers for some popular + // images, like "ubuntu", "debian", but they will be refreshed at the time you + // attempt to use them. + // + // If you built an image in a previous build step, it will be stored in the + // host's Docker daemon's cache and is available to use as the name for a + // later build step. + string name = 1; + + // A list of environment variable definitions to be used when running a step. + // + // The elements are of the form "KEY=VALUE" for the environment variable "KEY" + // being given the value "VALUE". + repeated string env = 2; + + // A list of arguments that will be presented to the step when it is started. + // + // If the image used to run the step's container has an entrypoint, the `args` + // are used as arguments to that entrypoint. If the image does not define + // an entrypoint, the first element in args is used as the entrypoint, + // and the remainder will be used as arguments. + repeated string args = 3; + + // Working directory to use when running this step's container. + // + // If this value is a relative path, it is relative to the build's working + // directory. If this value is absolute, it may be outside the build's working + // directory, in which case the contents of the path may not be persisted + // across build step executions, unless a `volume` for that path is specified. + // + // If the build specifies a `RepoSource` with `dir` and a step with a `dir`, + // which specifies an absolute path, the `RepoSource` `dir` is ignored for + // the step's execution. + string dir = 4; + + // Unique identifier for this build step, used in `wait_for` to + // reference this build step as a dependency. + string id = 5; + + // The ID(s) of the step(s) that this build step depends on. + // This build step will not start until all the build steps in `wait_for` + // have completed successfully. If `wait_for` is empty, this build step will + // start when all previous build steps in the `Build.Steps` list have + // completed successfully. + repeated string wait_for = 6; + + // Entrypoint to be used instead of the build step image's default entrypoint. + // If unset, the image's default entrypoint is used. + string entrypoint = 7; + + // A list of environment variables which are encrypted using a Cloud Key + // Management Service crypto key. These values must be specified in the + // build's `Secret`. + repeated string secret_env = 8; + + // List of volumes to mount into the build step. + // + // Each volume is created as an empty volume prior to execution of the + // build step. Upon completion of the build, volumes and their contents are + // discarded. + // + // Using a named volume in only one step is not valid as it is indicative + // of a build request with an incorrect configuration. + repeated Volume volumes = 9; + + // Output only. Stores timing information for executing this build step. + TimeSpan timing = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Stores timing information for pulling this build step's + // builder image only. + TimeSpan pull_timing = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Time limit for executing this build step. If not defined, the step has no + // time limit and will be allowed to continue to run until either it completes + // or the build itself times out. + google.protobuf.Duration timeout = 11; + + // Output only. Status of the build step. At this time, build step status is + // only updated on build completion; step status is not updated in real-time + // as the build progresses. + Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allow this build step to fail without failing the entire build. + // + // If false, the entire build will fail if this step fails. Otherwise, the + // build will succeed, but this step will still have a failure status. + // Error information will be reported in the failure_detail field. + bool allow_failure = 14; + + // Output only. Return code from running the step. + int32 exit_code = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Allow this build step to fail without failing the entire build if and + // only if the exit code is one of the specified codes. If allow_failure + // is also specified, this field will take precedence. + repeated int32 allow_exit_codes = 18; + + // A shell script to be executed in the step. + // + // When script is provided, the user cannot specify the entrypoint or args. + string script = 19; +} + +// Volume describes a Docker container volume which is mounted into build steps +// in order to persist files across build step execution. +message Volume { + // Name of the volume to mount. + // + // Volume names must be unique per build step and must be valid names for + // Docker volumes. Each named volume must be used by at least two build steps. + string name = 1; + + // Path at which to mount the volume. + // + // Paths must be absolute and cannot conflict with other volume paths on the + // same build step or with certain reserved volume paths. + string path = 2; +} + +// Artifacts created by the build pipeline. +message Results { + // Container images that were built as a part of the build. + repeated BuiltImage images = 2; + + // List of build step digests, in the order corresponding to build step + // indices. + repeated string build_step_images = 3; + + // Path to the artifact manifest. Only populated when artifacts are uploaded. + string artifact_manifest = 4; + + // Number of artifacts uploaded. Only populated when artifacts are uploaded. + int64 num_artifacts = 5; + + // List of build step outputs, produced by builder images, in the order + // corresponding to build step indices. + // + // [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) + // can produce this output by writing to `$BUILDER_OUTPUT/output`. + // Only the first 4KB of data is stored. + repeated bytes build_step_outputs = 6; + + // Time to push all non-container artifacts. + TimeSpan artifact_timing = 7; + + // Python artifacts uploaded to Artifact Registry at the end of the build. + repeated UploadedPythonPackage python_packages = 8; + + // Maven artifacts uploaded to Artifact Registry at the end of the build. + repeated UploadedMavenArtifact maven_artifacts = 9; +} + +// An artifact that was uploaded during a build. This +// is a single record in the artifact manifest JSON file. +message ArtifactResult { + // The path of an artifact in a Google Cloud Storage bucket, with the + // generation number. For example, + // `gs://mybucket/path/to/output.jar#generation`. + string location = 1; + + // The file hash of the artifact. + repeated FileHashes file_hash = 2; +} + +// A build resource in the Cloud Build API. +// +// At a high level, a `Build` describes where to find source code, how to build +// it (for example, the builder image to run on the source), and where to store +// the built artifacts. +// +// Fields can include the following variables, which will be expanded when the +// build is created: +// +// - $PROJECT_ID: the project ID of the build. +// - $PROJECT_NUMBER: the project number of the build. +// - $BUILD_ID: the autogenerated ID of the build. +// - $REPO_NAME: the source repository name specified by RepoSource. +// - $BRANCH_NAME: the branch name specified by RepoSource. +// - $TAG_NAME: the tag name specified by RepoSource. +// - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or +// resolved from the specified branch or tag. +// - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. +message Build { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/builds/{build}" + pattern: "projects/{project}/locations/{location}/builds/{build}" + }; + + // A non-fatal problem encountered during the execution of the build. + message Warning { + // The relative importance of this warning. + enum Priority { + // Should not be used. + PRIORITY_UNSPECIFIED = 0; + + // e.g. deprecation warnings and alternative feature highlights. + INFO = 1; + + // e.g. automated detection of possible issues with the build. + WARNING = 2; + + // e.g. alerts that a feature used in the build is pending removal + ALERT = 3; + } + + // Explanation of the warning generated. + string text = 1; + + // The priority for this warning. + Priority priority = 2; + } + + // A fatal problem encountered during the execution of the build. + message FailureInfo { + // The name of a fatal problem encountered during the execution of the + // build. + enum FailureType { + // Type unspecified + FAILURE_TYPE_UNSPECIFIED = 0; + + // Unable to push the image to the repository. + PUSH_FAILED = 1; + + // Final image not found. + PUSH_IMAGE_NOT_FOUND = 2; + + // Unauthorized push of the final image. + PUSH_NOT_AUTHORIZED = 3; + + // Backend logging failures. Should retry. + LOGGING_FAILURE = 4; + + // A build step has failed. + USER_BUILD_STEP = 5; + + // The source fetching has failed. + FETCH_SOURCE_FAILED = 6; + } + + // The name of the failure. + FailureType type = 1; + + // Explains the failure issue in more detail using hard-coded text. + string detail = 2; + } + + // Possible status of a build or build step. + enum Status { + // Status of the build is unknown. + STATUS_UNKNOWN = 0; + + // Build has been created and is pending execution and queuing. It has not + // been queued. + PENDING = 10; + + // Build or step is queued; work has not yet begun. + QUEUED = 1; + + // Build or step is being executed. + WORKING = 2; + + // Build or step finished successfully. + SUCCESS = 3; + + // Build or step failed to complete successfully. + FAILURE = 4; + + // Build or step failed due to an internal cause. + INTERNAL_ERROR = 5; + + // Build or step took longer than was allowed. + TIMEOUT = 6; + + // Build or step was canceled by a user. + CANCELLED = 7; + + // Build was enqueued for longer than the value of `queue_ttl`. + EXPIRED = 9; + } + + // Output only. The 'Build' name with format: + // `projects/{project}/locations/{location}/builds/{build}`, where {build} + // is a unique identifier generated by the service. + string name = 45 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Unique identifier of the build. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. ID of the project. + string project_id = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status of the build. + Status status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Customer-readable message about the current status. + string status_detail = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The location of the source files to build. + Source source = 3; + + // Required. The operations to be performed on the workspace. + repeated BuildStep steps = 11; + + // Output only. Results of the build. + Results results = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the request to create the build was received. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which execution of the build was started. + google.protobuf.Timestamp start_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which execution of the build was finished. + // + // The difference between finish_time and start_time is the duration of the + // build's execution. + google.protobuf.Timestamp finish_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Amount of time that this build should be allowed to run, to second + // granularity. If this amount of time elapses, work on the build will cease + // and the build status will be `TIMEOUT`. + // + // `timeout` starts ticking from `startTime`. + // + // Default time is ten minutes. + google.protobuf.Duration timeout = 12; + + // A list of images to be pushed upon the successful completion of all build + // steps. + // + // The images are pushed using the builder service account's credentials. + // + // The digests of the pushed images will be stored in the `Build` resource's + // results field. + // + // If any of the images fail to be pushed, the build status is marked + // `FAILURE`. + repeated string images = 13; + + // TTL in queue for this build. If provided and the build is enqueued longer + // than this value, the build will expire and the build status will be + // `EXPIRED`. + // + // The TTL starts ticking from create_time. + google.protobuf.Duration queue_ttl = 40; + + // Artifacts produced by the build that should be uploaded upon + // successful completion of all build steps. + Artifacts artifacts = 37; + + // Google Cloud Storage bucket where logs should be written (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + // Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. + string logs_bucket = 19; + + // Output only. A permanent fixed identifier for source. + SourceProvenance source_provenance = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The ID of the `BuildTrigger` that triggered this build, if it + // was triggered automatically. + string build_trigger_id = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Special options for this build. + BuildOptions options = 23; + + // Output only. URL to logs for this build in Google Cloud Console. + string log_url = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Substitutions data for `Build` resource. + map substitutions = 29; + + // Tags for annotation of a `Build`. These are not docker tags. + repeated string tags = 31; + + // Secrets to decrypt using Cloud Key Management Service. + // Note: Secret Manager is the recommended technique + // for managing sensitive data with Cloud Build. Use `available_secrets` to + // configure builds to access secrets from Secret Manager. For instructions, + // see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets + repeated Secret secrets = 32; + + // Output only. Stores timing information for phases of the build. Valid keys + // are: + // + // * BUILD: time to execute all build steps. + // * PUSH: time to push all specified images. + // * FETCHSOURCE: time to fetch source. + // * SETUPBUILD: time to set up build. + // + // If the build does not specify source or images, + // these keys will not be included. + map timing = 33 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Describes this build's approval configuration, status, + // and result. + BuildApproval approval = 44 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // IAM service account whose credentials will be used at build runtime. + // Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + // ACCOUNT can be email address or uniqueId of the service account. + // + string service_account = 42 [(google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + }]; + + // Secrets and secret environment variables. + Secrets available_secrets = 47; + + // Output only. Non-fatal problems encountered during the execution of the + // build. + repeated Warning warnings = 49 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Contains information about the build when status=FAILURE. + FailureInfo failure_info = 51 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Artifacts produced by a build that should be uploaded upon +// successful completion of all build steps. +message Artifacts { + // Files in the workspace to upload to Cloud Storage upon successful + // completion of all build steps. + message ArtifactObjects { + // Cloud Storage bucket and optional object path, in the form + // "gs://bucket/path/to/somewhere/". (see [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + // + // Files in the workspace matching any path pattern will be uploaded to + // Cloud Storage with this location as a prefix. + string location = 1; + + // Path globs used to match files in the build's workspace. + repeated string paths = 2; + + // Output only. Stores timing information for pushing all artifact objects. + TimeSpan timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // A Maven artifact to upload to Artifact Registry upon successful completion + // of all build steps. + message MavenArtifact { + // Artifact Registry repository, in the form + // "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" + // + // Artifact in the workspace specified by path will be uploaded to + // Artifact Registry with this location as a prefix. + string repository = 1; + + // Path to an artifact in the build's workspace to be uploaded to + // Artifact Registry. + // This can be either an absolute path, + // e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar + // or a relative path from /workspace, + // e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. + string path = 2; + + // Maven `artifactId` value used when uploading the artifact to Artifact + // Registry. + string artifact_id = 3; + + // Maven `groupId` value used when uploading the artifact to Artifact + // Registry. + string group_id = 4; + + // Maven `version` value used when uploading the artifact to Artifact + // Registry. + string version = 5; + } + + // Python package to upload to Artifact Registry upon successful completion + // of all build steps. A package can encapsulate multiple objects to be + // uploaded to a single repository. + message PythonPackage { + // Artifact Registry repository, in the form + // "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" + // + // Files in the workspace matching any path pattern will be uploaded to + // Artifact Registry with this location as a prefix. + string repository = 1; + + // Path globs used to match files in the build's workspace. For Python/ + // Twine, this is usually `dist/*`, and sometimes additionally an `.asc` + // file. + repeated string paths = 2; + } + + // A list of images to be pushed upon the successful completion of all build + // steps. + // + // The images will be pushed using the builder service account's credentials. + // + // The digests of the pushed images will be stored in the Build resource's + // results field. + // + // If any of the images fail to be pushed, the build is marked FAILURE. + repeated string images = 1; + + // A list of objects to be uploaded to Cloud Storage upon successful + // completion of all build steps. + // + // Files in the workspace matching specified paths globs will be uploaded to + // the specified Cloud Storage location using the builder service account's + // credentials. + // + // The location and generation of the uploaded objects will be stored in the + // Build resource's results field. + // + // If any objects fail to be pushed, the build is marked FAILURE. + ArtifactObjects objects = 2; + + // A list of Maven artifacts to be uploaded to Artifact Registry upon + // successful completion of all build steps. + // + // Artifacts in the workspace matching specified paths globs will be uploaded + // to the specified Artifact Registry repository using the builder service + // account's credentials. + // + // If any artifacts fail to be pushed, the build is marked FAILURE. + repeated MavenArtifact maven_artifacts = 3; + + // A list of Python packages to be uploaded to Artifact Registry upon + // successful completion of all build steps. + // + // The build service account credentials will be used to perform the upload. + // + // If any objects fail to be pushed, the build is marked FAILURE. + repeated PythonPackage python_packages = 5; +} + +// Start and end times for a build execution phase. +message TimeSpan { + // Start of time span. + google.protobuf.Timestamp start_time = 1; + + // End of time span. + google.protobuf.Timestamp end_time = 2; +} + +// Metadata for build operations. +message BuildOperationMetadata { + // The build that the operation is tracking. + Build build = 1; +} + +// Provenance of the source. Ways to find the original source, or verify that +// some source was used for this build. +message SourceProvenance { + // A copy of the build's `source.storage_source`, if exists, with any + // generations resolved. + StorageSource resolved_storage_source = 3; + + // A copy of the build's `source.repo_source`, if exists, with any + // revisions resolved. + RepoSource resolved_repo_source = 6; + + // A copy of the build's `source.storage_source_manifest`, if exists, with any + // revisions resolved. + // This feature is in Preview. + StorageSourceManifest resolved_storage_source_manifest = 9; + + // Output only. Hash(es) of the build source, which can be used to verify that + // the original source integrity was maintained in the build. Note that + // `FileHashes` will only be populated if `BuildOptions` has requested a + // `SourceProvenanceHash`. + // + // The keys to this map are file paths used as build source and the values + // contain the hash values for those files. + // + // If the build source came in a single package such as a gzipped tarfile + // (`.tar.gz`), the `FileHash` will be for the single path to that file. + map file_hashes = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Container message for hashes of byte content of files, used in +// SourceProvenance messages to verify integrity of source input to the build. +message FileHashes { + // Collection of file hashes. + repeated Hash file_hash = 1; +} + +// Container message for hash values. +message Hash { + // Specifies the hash algorithm, if any. + enum HashType { + // No hash requested. + NONE = 0; + + // Use a sha256 hash. + SHA256 = 1; + + // Use a md5 hash. + MD5 = 2; + } + + // The type of hash that was performed. + HashType type = 1; + + // The hash value. + bytes value = 2; +} + +// Secrets and secret environment variables. +message Secrets { + // Secrets in Secret Manager and associated secret environment variable. + repeated SecretManagerSecret secret_manager = 1; + + // Secrets encrypted with KMS key and the associated secret environment + // variable. + repeated InlineSecret inline = 2; +} + +// Pairs a set of secret environment variables mapped to encrypted +// values with the Cloud KMS key to use to decrypt the value. +message InlineSecret { + // Resource name of Cloud KMS crypto key to decrypt the encrypted value. + // In format: projects/*/locations/*/keyRings/*/cryptoKeys/* + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Map of environment variable name to its encrypted value. + // + // Secret environment variables must be unique across all of a build's + // secrets, and must be used by at least one build step. Values can be at most + // 64 KB in size. There can be at most 100 secret values across all of a + // build's secrets. + map env_map = 2; +} + +// Pairs a secret environment variable with a SecretVersion in Secret Manager. +message SecretManagerSecret { + // Resource name of the SecretVersion. In format: + // projects/*/secrets/*/versions/* + string version_name = 1 [(google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + }]; + + // Environment variable name to associate with the secret. + // Secret environment variables must be unique across all of a build's + // secrets, and must be used by at least one build step. + string env = 2; +} + +// Pairs a set of secret environment variables containing encrypted +// values with the Cloud KMS key to use to decrypt the value. +// Note: Use `kmsKeyName` with `available_secrets` instead of using +// `kmsKeyName` with `secret`. For instructions see: +// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. +message Secret { + // Cloud KMS key name to use to decrypt these envs. + string kms_key_name = 1; + + // Map of environment variable name to its encrypted value. + // + // Secret environment variables must be unique across all of a build's + // secrets, and must be used by at least one build step. Values can be at most + // 64 KB in size. There can be at most 100 secret values across all of a + // build's secrets. + map secret_env = 3; +} + +// Request to create a new build. +message CreateBuildRequest { + // The parent resource where this build will be created. + // Format: `projects/{project}/locations/{location}` + string parent = 4 [(google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Build" + }]; + + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Build resource to create. + Build build = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to get a build. +message GetBuildRequest { + // The name of the `Build` to retrieve. + // Format: `projects/{project}/locations/{location}/builds/{build}` + string name = 4 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + }]; + + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the build. + string id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to list builds. +message ListBuildsRequest { + // The parent of the collection of `Builds`. + // Format: `projects/{project}/locations/location` + string parent = 9 [(google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/Build" + }]; + + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Number of results to return in the list. + int32 page_size = 2; + + // The page token for the next page of Builds. + // + // If unspecified, the first page of results is returned. + // + // If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + // In this case, the token should be discarded, and pagination should be + // restarted from the first page of results. + // + // See https://google.aip.dev/158 for more. + string page_token = 3; + + // The raw filter text to constrain the results. + string filter = 8; +} + +// Response including listed builds. +message ListBuildsResponse { + // Builds will be sorted by `create_time`, descending. + repeated Build builds = 1; + + // Token to receive the next page of results. + // This will be absent if the end of the response list has been reached. + string next_page_token = 2; +} + +// Request to cancel an ongoing build. +message CancelBuildRequest { + // The name of the `Build` to cancel. + // Format: `projects/{project}/locations/{location}/builds/{build}` + string name = 4 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + }]; + + // Required. ID of the project. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the build. + string id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to approve or reject a pending build. +message ApproveBuildRequest { + // Required. Name of the target build. + // For example: "projects/{$project_id}/builds/{$build_id}" + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Approval decision and metadata. + ApprovalResult approval_result = 2; +} + +// BuildApproval describes a build's approval configuration, state, and +// result. +message BuildApproval { + // Specifies the current state of a build's approval. + enum State { + // Default enum type. This should not be used. + STATE_UNSPECIFIED = 0; + + // Build approval is pending. + PENDING = 1; + + // Build approval has been approved. + APPROVED = 2; + + // Build approval has been rejected. + REJECTED = 3; + + // Build was cancelled while it was still pending approval. + CANCELLED = 5; + } + + // Output only. The state of this build's approval. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Configuration for manual approval of this build. + ApprovalConfig config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Result of manual approval for this Build. + ApprovalResult result = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ApprovalConfig describes configuration for manual approval of a build. +message ApprovalConfig { + // Whether or not approval is needed. If this is set on a build, it will + // become pending when created, and will need to be explicitly approved + // to start. + bool approval_required = 1; +} + +// ApprovalResult describes the decision and associated metadata of a manual +// approval of a build. +message ApprovalResult { + // Specifies whether or not this manual approval result is to approve + // or reject a build. + enum Decision { + // Default enum type. This should not be used. + DECISION_UNSPECIFIED = 0; + + // Build is approved. + APPROVED = 1; + + // Build is rejected. + REJECTED = 2; + } + + // Output only. Email of the user that called the ApproveBuild API to + // approve or reject a build at the time that the API was called. + string approver_account = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the approval decision was made. + google.protobuf.Timestamp approval_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The decision of this manual approval. + Decision decision = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional comment for this manual approval result. + string comment = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional URL tied to this manual approval result. This field + // is essentially the same as comment, except that it will be rendered by the + // UI differently. An example use case is a link to an external job that + // approved this Build. + string url = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for an automated build in response to source repository +// changes. +message BuildTrigger { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/BuildTrigger" + plural: "triggers" + singular: "trigger" + pattern: "projects/{project}/triggers/{trigger}" + pattern: "projects/{project}/locations/{location}/triggers/{trigger}" + }; + + // The `Trigger` name with format: + // `projects/{project}/locations/{location}/triggers/{trigger}`, where + // {trigger} is a unique identifier generated by the service. + string resource_name = 34; + + // Output only. Unique identifier of the trigger. + string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Human-readable description of this trigger. + string description = 10; + + // User-assigned name of the trigger. Must be unique within the project. + // Trigger names must meet the following requirements: + // + // + They must contain only alphanumeric characters and dashes. + // + They can be 1-64 characters long. + // + They must begin and end with an alphanumeric character. + string name = 21; + + // Tags for annotation of a `BuildTrigger` + repeated string tags = 19; + + // Template describing the types of source changes to trigger a build. + // + // Branch and tag names in trigger templates are interpreted as regular + // expressions. Any branch or tag change that matches that regular expression + // will trigger a build. + // + // Mutually exclusive with `github`. + RepoSource trigger_template = 7; + + // GitHubEventsConfig describes the configuration of a trigger that creates + // a build whenever a GitHub event is received. + // + // Mutually exclusive with `trigger_template`. + GitHubEventsConfig github = 13; + + // PubsubConfig describes the configuration of a trigger that + // creates a build whenever a Pub/Sub message is published. + PubsubConfig pubsub_config = 29; + + // WebhookConfig describes the configuration of a trigger that + // creates a build whenever a webhook is sent to a trigger's webhook URL. + WebhookConfig webhook_config = 31; + + // Template describing the Build request to make when the trigger is matched. + oneof build_template { + // Autodetect build configuration. The following precedence is used (case + // insensitive): + // + // 1. cloudbuild.yaml + // 2. cloudbuild.yml + // 3. cloudbuild.json + // 4. Dockerfile + // + // Currently only available for GitHub App Triggers. + bool autodetect = 18; + + // Contents of the build template. + Build build = 4; + + // Path, from the source root, to the build configuration file + // (i.e. cloudbuild.yaml). + string filename = 8; + } + + // Output only. Time when the trigger was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If true, the trigger will never automatically execute a build. + bool disabled = 9; + + // Substitutions for Build resource. The keys must match the following + // regular expression: `^_[A-Z0-9_]+$`. + map substitutions = 11; + + // ignored_files and included_files are file glob matches using + // https://golang.org/pkg/path/filepath/#Match extended with support for "**". + // + // If ignored_files and changed files are both empty, then they are + // not used to determine whether or not to trigger a build. + // + // If ignored_files is not empty, then we ignore any files that match + // any of the ignored_file globs. If the change has no files that are + // outside of the ignored_files globs, then we do not trigger a build. + repeated string ignored_files = 15; + + // If any of the files altered in the commit pass the ignored_files + // filter and included_files is empty, then as far as this filter is + // concerned, we should trigger the build. + // + // If any of the files altered in the commit pass the ignored_files + // filter and included_files is not empty, then we make sure that at + // least one of those files matches a included_files glob. If not, + // then we do not trigger a build. + repeated string included_files = 16; + + // Optional. A Common Expression Language string. + string filter = 30 [(google.api.field_behavior) = OPTIONAL]; + + // The service account used for all user-controlled operations including + // UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. + // If no service account is set, then the standard Cloud Build service account + // ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. + // Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` + string service_account = 33 [(google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + }]; +} + +// GitHubEventsConfig describes the configuration of a trigger that creates a +// build whenever a GitHub event is received. +// +// This message is experimental. +message GitHubEventsConfig { + // The installationID that emits the GitHub event. + int64 installation_id = 1 [deprecated = true]; + + // Owner of the repository. For example: The owner for + // https://github.com/googlecloudplatform/cloud-builders is + // "googlecloudplatform". + string owner = 6; + + // Name of the repository. For example: The name for + // https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". + string name = 7; + + // Filter describing the types of events to trigger a build. + // Currently supported event types: push, pull_request. + oneof event { + // filter to match changes in pull requests. + PullRequestFilter pull_request = 4; + + // filter to match changes in refs like branches, tags. + PushFilter push = 5; + } +} + +// PubsubConfig describes the configuration of a trigger that +// creates a build whenever a Pub/Sub message is published. +message PubsubConfig { + // Enumerates potential issues with the underlying Pub/Sub subscription + // configuration. + enum State { + // The subscription configuration has not been checked. + STATE_UNSPECIFIED = 0; + + // The Pub/Sub subscription is properly configured. + OK = 1; + + // The subscription has been deleted. + SUBSCRIPTION_DELETED = 2; + + // The topic has been deleted. + TOPIC_DELETED = 3; + + // Some of the subscription's field are misconfigured. + SUBSCRIPTION_MISCONFIGURED = 4; + } + + // Output only. Name of the subscription. Format is + // `projects/{project}/subscriptions/{subscription}`. + string subscription = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Subscription" + } + ]; + + // The name of the topic from which this subscription is receiving messages. + // Format is `projects/{project}/topics/{topic}`. + string topic = 2 [ + (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" } + ]; + + // Service account that will make the push request. + string service_account_email = 3 [(google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + }]; + + // Potential issues with the underlying Pub/Sub subscription configuration. + // Only populated on get requests. + State state = 4; +} + +// WebhookConfig describes the configuration of a trigger that +// creates a build whenever a webhook is sent to a trigger's webhook URL. +message WebhookConfig { + // Enumerates potential issues with the Secret Manager secret provided by the + // user. + enum State { + // The webhook auth configuration not been checked. + STATE_UNSPECIFIED = 0; + + // The auth configuration is properly setup. + OK = 1; + + // The secret provided in auth_method has been deleted. + SECRET_DELETED = 2; + } + + // Auth method specifies how the webhook authenticates with GCP. + oneof auth_method { + // Required. Resource name for the secret required as a URL parameter. + string secret = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // Potential issues with the underlying Pub/Sub subscription configuration. + // Only populated on get requests. + State state = 4; +} + +// PullRequestFilter contains filter properties for matching GitHub Pull +// Requests. +message PullRequestFilter { + // Controls behavior of Pull Request comments. + enum CommentControl { + // Do not require comments on Pull Requests before builds are triggered. + COMMENTS_DISABLED = 0; + + // Enforce that repository owners or collaborators must comment on Pull + // Requests before builds are triggered. + COMMENTS_ENABLED = 1; + + // Enforce that repository owners or collaborators must comment on external + // contributors' Pull Requests before builds are triggered. + COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; + } + + // Target refs to match. + // A target ref is the git reference where the pull request will be applied. + oneof git_ref { + // Regex of branches to match. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string branch = 2; + } + + // Configure builds to run whether a repository owner or collaborator need to + // comment `/gcbrun`. + CommentControl comment_control = 5; + + // If true, branches that do NOT match the git_ref will trigger a build. + bool invert_regex = 6; +} + +// Push contains filter properties for matching GitHub git pushes. +message PushFilter { + // Modified refs to match. + // A modified refs are the refs modified by a git push operation. + oneof git_ref { + // Regexes matching branches to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string branch = 2; + + // Regexes matching tags to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string tag = 3; + } + + // When true, only trigger a build if the revision regex does NOT match the + // git_ref regex. + bool invert_regex = 4; +} + +// Request to create a new `BuildTrigger`. +message CreateBuildTriggerRequest { + // The parent resource where this trigger will be created. + // Format: `projects/{project}/locations/{location}` + string parent = 3 [(google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/BuildTrigger" + }]; + + // Required. ID of the project for which to configure automatic builds. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. `BuildTrigger` to create. + BuildTrigger trigger = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Returns the `BuildTrigger` with the specified ID. +message GetBuildTriggerRequest { + // The name of the `Trigger` to retrieve. + // Format: `projects/{project}/locations/{location}/triggers/{trigger}` + string name = 3 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/BuildTrigger" + }]; + + // Required. ID of the project that owns the trigger. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. + string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to list existing `BuildTriggers`. +message ListBuildTriggersRequest { + // The parent of the collection of `Triggers`. + // Format: `projects/{project}/locations/{location}` + string parent = 4 [(google.api.resource_reference) = { + child_type: "cloudbuild.googleapis.com/BuildTrigger" + }]; + + // Required. ID of the project for which to list BuildTriggers. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Number of results to return in the list. + int32 page_size = 2; + + // Token to provide to skip to a particular spot in the list. + string page_token = 3; +} + +// Response containing existing `BuildTriggers`. +message ListBuildTriggersResponse { + // `BuildTriggers` for the project, sorted by `create_time` descending. + repeated BuildTrigger triggers = 1; + + // Token to receive the next page of results. + string next_page_token = 2; +} + +// Request to delete a `BuildTrigger`. +message DeleteBuildTriggerRequest { + // The name of the `Trigger` to delete. + // Format: `projects/{project}/locations/{location}/triggers/{trigger}` + string name = 3 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/BuildTrigger" + }]; + + // Required. ID of the project that owns the trigger. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the `BuildTrigger` to delete. + string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to update an existing `BuildTrigger`. +message UpdateBuildTriggerRequest { + // Required. ID of the project that owns the trigger. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. ID of the `BuildTrigger` to update. + string trigger_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. `BuildTrigger` to update. + BuildTrigger trigger = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Optional arguments to enable specific features of builds. +message BuildOptions { + // Details about how a build should be executed on a `WorkerPool`. + // + // See [running builds in a private + // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) + // for more information. + message PoolOption { + // The `WorkerPool` resource to execute the build on. + // You must have `cloudbuild.workerpools.use` on the project hosting the + // WorkerPool. + // + // Format projects/{project}/locations/{location}/workerPools/{workerPoolId} + string name = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + } + + // Specifies the manner in which the build should be verified, if at all. + enum VerifyOption { + // Not a verifiable build. (default) + NOT_VERIFIED = 0; + + // Verified build. + VERIFIED = 1; + } + + // Supported Compute Engine machine types. + // For more information, see [Machine + // types](https://cloud.google.com/compute/docs/machine-types). + enum MachineType { + // Standard machine type. + UNSPECIFIED = 0; + + // Highcpu machine with 8 CPUs. + N1_HIGHCPU_8 = 1; + + // Highcpu machine with 32 CPUs. + N1_HIGHCPU_32 = 2; + + // Highcpu e2 machine with 8 CPUs. + E2_HIGHCPU_8 = 5; + + // Highcpu e2 machine with 32 CPUs. + E2_HIGHCPU_32 = 6; + } + + // Specifies the behavior when there is an error in the substitution checks. + enum SubstitutionOption { + // Fails the build if error in substitutions checks, like missing + // a substitution in the template or in the map. + MUST_MATCH = 0; + + // Do not fail the build if error in substitutions checks. + ALLOW_LOOSE = 1; + } + + // Specifies the behavior when writing build logs to Google Cloud Storage. + enum LogStreamingOption { + // Service may automatically determine build log streaming behavior. + STREAM_DEFAULT = 0; + + // Build logs should be streamed to Google Cloud Storage. + STREAM_ON = 1; + + // Build logs should not be streamed to Google Cloud Storage; they will be + // written when the build is completed. + STREAM_OFF = 2; + } + + // Specifies the logging mode. + enum LoggingMode { + // The service determines the logging mode. The default is `LEGACY`. Do not + // rely on the default logging behavior as it may change in the future. + LOGGING_UNSPECIFIED = 0; + + // Cloud Logging and Cloud Storage logging are enabled. + LEGACY = 1; + + // Only Cloud Storage logging is enabled. + GCS_ONLY = 2; + + // This option is the same as CLOUD_LOGGING_ONLY. + STACKDRIVER_ONLY = 3 [deprecated = true]; + + // Only Cloud Logging is enabled. Note that logs for both the Cloud Console + // UI and Cloud SDK are based on Cloud Storage logs, so neither will provide + // logs if this option is chosen. + CLOUD_LOGGING_ONLY = 5; + + // Turn off all logging. No build logs will be captured. + NONE = 4; + } + + // Requested hash for SourceProvenance. + repeated Hash.HashType source_provenance_hash = 1; + + // Requested verifiability options. + VerifyOption requested_verify_option = 2; + + // Compute Engine machine type on which to run the build. + MachineType machine_type = 3; + + // Requested disk size for the VM that runs the build. Note that this is *NOT* + // "disk free"; some of the space will be used by the operating system and + // build utilities. Also note that this is the minimum disk size that will be + // allocated for the build -- the build may run with a larger disk than + // requested. At present, the maximum disk size is 1000GB; builds that request + // more than the maximum are rejected with an error. + int64 disk_size_gb = 6; + + // Option to specify behavior when there is an error in the substitution + // checks. + // + // NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot + // be overridden in the build configuration file. + SubstitutionOption substitution_option = 4; + + // Option to specify whether or not to apply bash style string + // operations to the substitutions. + // + // NOTE: this is always enabled for triggered builds and cannot be + // overridden in the build configuration file. + bool dynamic_substitutions = 17; + + // Option to define build log streaming behavior to Google Cloud + // Storage. + LogStreamingOption log_streaming_option = 5; + + // This field deprecated; please use `pool.name` instead. + string worker_pool = 7 [deprecated = true]; + + // Optional. Specification for execution on a `WorkerPool`. + // + // See [running builds in a private + // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) + // for more information. + PoolOption pool = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Option to specify the logging mode, which determines if and where build + // logs are stored. + LoggingMode logging = 11; + + // A list of global environment variable definitions that will exist for all + // build steps in this build. If a variable is defined in both globally and in + // a build step, the variable will use the build step value. + // + // The elements are of the form "KEY=VALUE" for the environment variable "KEY" + // being given the value "VALUE". + repeated string env = 12; + + // A list of global environment variables, which are encrypted using a Cloud + // Key Management Service crypto key. These values must be specified in the + // build's `Secret`. These variables will be available to all build steps + // in this build. + repeated string secret_env = 13; + + // Global list of volumes to mount for ALL build steps + // + // Each volume is created as an empty volume prior to starting the build + // process. Upon completion of the build, volumes and their contents are + // discarded. Global volume names and paths cannot conflict with the volumes + // defined a build step. + // + // Using a global volume in a build with only one step is not valid as + // it is indicative of a build request with an incorrect configuration. + repeated Volume volumes = 14; +} + +// ReceiveTriggerWebhookRequest [Experimental] is the request object accepted by +// the ReceiveTriggerWebhook method. +message ReceiveTriggerWebhookRequest { + // The name of the `ReceiveTriggerWebhook` to retrieve. + // Format: `projects/{project}/locations/{location}/triggers/{trigger}` + string name = 5; + + // HTTP request body. + google.api.HttpBody body = 1; + + // Project in which the specified trigger lives + string project_id = 2; + + // Name of the trigger to run the payload against + string trigger = 3; + + // Secret token used for authorization if an OAuth token isn't provided. + string secret = 4; +} + +// ReceiveTriggerWebhookResponse [Experimental] is the response object for the +// ReceiveTriggerWebhook method. +message ReceiveTriggerWebhookResponse {} + +// Configuration for a `WorkerPool`. +// +// Cloud Build owns and maintains a pool of workers for general use and have no +// access to a project's private network. By default, builds submitted to +// Cloud Build will use a worker from this pool. +// +// If your build needs access to resources on a private network, +// create and use a `WorkerPool` to run your builds. Private `WorkerPool`s give +// your builds access to any single VPC network that you +// administer, including any on-prem resources connected to that VPC +// network. For an overview of private pools, see +// [Private pools +// overview](https://cloud.google.com/build/docs/private-pools/private-pools-overview). +message WorkerPool { + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" + plural: "workerPools" + singular: "workerPool" + style: DECLARATIVE_FRIENDLY + }; + + // State of the `WorkerPool`. + enum State { + // State of the `WorkerPool` is unknown. + STATE_UNSPECIFIED = 0; + + // `WorkerPool` is being created. + CREATING = 1; + + // `WorkerPool` is running. + RUNNING = 2; + + // `WorkerPool` is being deleted: cancelling builds and draining workers. + DELETING = 3; + + // `WorkerPool` is deleted. + DELETED = 4; + } + + // Output only. The resource name of the `WorkerPool`, with format + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + // The value of `{worker_pool}` is provided by `worker_pool_id` in + // `CreateWorkerPool` request and the value of `{location}` is determined by + // the endpoint accessed. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A user-specified, human-readable name for the `WorkerPool`. If provided, + // this value must be 1-63 characters. + string display_name = 2; + + // Output only. A unique identifier for the `WorkerPool`. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User specified annotations. See https://google.aip.dev/128#annotations + // for more details such as format and size limitations. + map annotations = 4; + + // Output only. Time at which the request to create the `WorkerPool` was + // received. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the request to update the `WorkerPool` was + // received. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time at which the request to delete the `WorkerPool` was + // received. + google.protobuf.Timestamp delete_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. `WorkerPool` state. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Private Pool configuration for the `WorkerPool`. + oneof config { + // Private Pool using a v1 configuration. + PrivatePoolV1Config private_pool_v1_config = 12; + } + + // Output only. Checksum computed by the server. May be sent on update and + // delete requests to ensure that the client has an up-to-date value before + // proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for a V1 `PrivatePool`. +message PrivatePoolV1Config { + // Defines the configuration to be used for creating workers in + // the pool. + message WorkerConfig { + // Machine type of a worker, such as `e2-medium`. + // See [Worker pool config + // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). + // If left blank, Cloud Build will use a sensible default. + string machine_type = 1; + + // Size of the disk attached to the worker, in GB. + // See [Worker pool config + // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). + // Specify a value of up to 1000. If `0` is specified, Cloud Build will use + // a standard disk size. + int64 disk_size_gb = 2; + } + + // Defines the network configuration for the pool. + message NetworkConfig { + // Defines the egress option for the pool. + enum EgressOption { + // If set, defaults to PUBLIC_EGRESS. + EGRESS_OPTION_UNSPECIFIED = 0; + + // If set, workers are created without any public address, which prevents + // network egress to public IPs unless a network proxy is configured. + NO_PUBLIC_EGRESS = 1; + + // If set, workers are created with a public address which allows for + // public internet egress. + PUBLIC_EGRESS = 2; + } + + // Required. Immutable. The network definition that the workers are peered + // to. If this section is left empty, the workers will be peered to + // `WorkerPool.project_id` on the service producer network. Must be in the + // format `projects/{project}/global/networks/{network}`, where `{project}` + // is a project number, such as `12345`, and `{network}` is the name of a + // VPC network in the project. See + // [Understanding network configuration + // options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) + string peered_network = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Option to configure network egress for the workers. + EgressOption egress_option = 2; + } + + // Machine configuration for the workers in the pool. + WorkerConfig worker_config = 1; + + // Network configuration for the pool. + NetworkConfig network_config = 2; +} + +// Request to create a new `WorkerPool`. +message CreateWorkerPoolRequest { + // Required. The parent resource where this worker pool will be created. + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. `WorkerPool` resource to create. + WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The ID to use for the `WorkerPool`, which will become + // the final component of the resource name. + // + // This value should be 1-63 characters, and valid characters + // are /[a-z][0-9]-/. + string worker_pool_id = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // If set, validate the request and preview the response, but do not actually + // post it. + bool validate_only = 4; +} + +// Request to get a `WorkerPool` with the specified name. +message GetWorkerPoolRequest { + // Required. The name of the `WorkerPool` to retrieve. + // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; +} + +// Request to delete a `WorkerPool`. +message DeleteWorkerPoolRequest { + // Required. The name of the `WorkerPool` to delete. + // Format: + // `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; + + // Optional. If this is provided, it must match the server's etag on the + // workerpool for the request to be processed. + string etag = 2; + + // If set to true, and the `WorkerPool` is not found, the request will succeed + // but no action will be taken on the server. + bool allow_missing = 3; + + // If set, validate the request and preview the response, but do not actually + // post it. + bool validate_only = 4; +} + +// Request to update a `WorkerPool`. +message UpdateWorkerPoolRequest { + // Required. The `WorkerPool` to update. + // + // The `name` field is used to identify the `WorkerPool` to update. + // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // A mask specifying which fields in `worker_pool` to update. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the response, but do not actually + // post it. + bool validate_only = 4; +} + +// Request to list `WorkerPool`s. +message ListWorkerPoolsRequest { + // Required. The parent of the collection of `WorkerPools`. + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of `WorkerPool`s to return. The service may return + // fewer than this value. If omitted, the server will use a sensible default. + int32 page_size = 2; + + // A page token, received from a previous `ListWorkerPools` call. Provide this + // to retrieve the subsequent page. + string page_token = 3; +} + +// Response containing existing `WorkerPools`. +message ListWorkerPoolsResponse { + // `WorkerPools` for the specified project. + repeated WorkerPool worker_pools = 1; + + // Continuation token used to page through large result sets. Provide this + // value in a subsequent ListWorkerPoolsRequest to return the next page of + // results. + string next_page_token = 2; +} + +// Metadata for the `CreateWorkerPool` operation. +message CreateWorkerPoolOperationMetadata { + // The resource name of the `WorkerPool` to create. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + string worker_pool = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // Time the operation was created. + google.protobuf.Timestamp create_time = 2; + + // Time the operation was completed. + google.protobuf.Timestamp complete_time = 3; +} + +// Metadata for the `UpdateWorkerPool` operation. +message UpdateWorkerPoolOperationMetadata { + // The resource name of the `WorkerPool` being updated. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + string worker_pool = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // Time the operation was created. + google.protobuf.Timestamp create_time = 2; + + // Time the operation was completed. + google.protobuf.Timestamp complete_time = 3; +} + +// Metadata for the `DeleteWorkerPool` operation. +message DeleteWorkerPoolOperationMetadata { + // The resource name of the `WorkerPool` being deleted. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + string worker_pool = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // Time the operation was created. + google.protobuf.Timestamp create_time = 2; + + // Time the operation was completed. + google.protobuf.Timestamp complete_time = 3; +} diff --git a/packages/google-devtools-cloudbuild/protos/protos.d.ts b/packages/google-devtools-cloudbuild/protos/protos.d.ts new file mode 100644 index 000000000000..4a2570fd8983 --- /dev/null +++ b/packages/google-devtools-cloudbuild/protos/protos.d.ts @@ -0,0 +1,14012 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace devtools. */ + namespace devtools { + + /** Namespace cloudbuild. */ + namespace cloudbuild { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudBuild */ + class CloudBuild extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudBuild 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 CloudBuild 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): CloudBuild; + + /** + * Calls CreateBuild. + * @param request CreateBuildRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBuild(request: google.devtools.cloudbuild.v1.ICreateBuildRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.CreateBuildCallback): void; + + /** + * Calls CreateBuild. + * @param request CreateBuildRequest message or plain object + * @returns Promise + */ + public createBuild(request: google.devtools.cloudbuild.v1.ICreateBuildRequest): Promise; + + /** + * Calls GetBuild. + * @param request GetBuildRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Build + */ + public getBuild(request: google.devtools.cloudbuild.v1.IGetBuildRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.GetBuildCallback): void; + + /** + * Calls GetBuild. + * @param request GetBuildRequest message or plain object + * @returns Promise + */ + public getBuild(request: google.devtools.cloudbuild.v1.IGetBuildRequest): Promise; + + /** + * Calls ListBuilds. + * @param request ListBuildsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBuildsResponse + */ + public listBuilds(request: google.devtools.cloudbuild.v1.IListBuildsRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.ListBuildsCallback): void; + + /** + * Calls ListBuilds. + * @param request ListBuildsRequest message or plain object + * @returns Promise + */ + public listBuilds(request: google.devtools.cloudbuild.v1.IListBuildsRequest): Promise; + + /** + * Calls CancelBuild. + * @param request CancelBuildRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Build + */ + public cancelBuild(request: google.devtools.cloudbuild.v1.ICancelBuildRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.CancelBuildCallback): void; + + /** + * Calls CancelBuild. + * @param request CancelBuildRequest message or plain object + * @returns Promise + */ + public cancelBuild(request: google.devtools.cloudbuild.v1.ICancelBuildRequest): Promise; + + /** + * Calls RetryBuild. + * @param request RetryBuildRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public retryBuild(request: google.devtools.cloudbuild.v1.IRetryBuildRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.RetryBuildCallback): void; + + /** + * Calls RetryBuild. + * @param request RetryBuildRequest message or plain object + * @returns Promise + */ + public retryBuild(request: google.devtools.cloudbuild.v1.IRetryBuildRequest): Promise; + + /** + * Calls ApproveBuild. + * @param request ApproveBuildRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public approveBuild(request: google.devtools.cloudbuild.v1.IApproveBuildRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.ApproveBuildCallback): void; + + /** + * Calls ApproveBuild. + * @param request ApproveBuildRequest message or plain object + * @returns Promise + */ + public approveBuild(request: google.devtools.cloudbuild.v1.IApproveBuildRequest): Promise; + + /** + * Calls CreateBuildTrigger. + * @param request CreateBuildTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BuildTrigger + */ + public createBuildTrigger(request: google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.CreateBuildTriggerCallback): void; + + /** + * Calls CreateBuildTrigger. + * @param request CreateBuildTriggerRequest message or plain object + * @returns Promise + */ + public createBuildTrigger(request: google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest): Promise; + + /** + * Calls GetBuildTrigger. + * @param request GetBuildTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BuildTrigger + */ + public getBuildTrigger(request: google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.GetBuildTriggerCallback): void; + + /** + * Calls GetBuildTrigger. + * @param request GetBuildTriggerRequest message or plain object + * @returns Promise + */ + public getBuildTrigger(request: google.devtools.cloudbuild.v1.IGetBuildTriggerRequest): Promise; + + /** + * Calls ListBuildTriggers. + * @param request ListBuildTriggersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBuildTriggersResponse + */ + public listBuildTriggers(request: google.devtools.cloudbuild.v1.IListBuildTriggersRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.ListBuildTriggersCallback): void; + + /** + * Calls ListBuildTriggers. + * @param request ListBuildTriggersRequest message or plain object + * @returns Promise + */ + public listBuildTriggers(request: google.devtools.cloudbuild.v1.IListBuildTriggersRequest): Promise; + + /** + * Calls DeleteBuildTrigger. + * @param request DeleteBuildTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBuildTrigger(request: google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.DeleteBuildTriggerCallback): void; + + /** + * Calls DeleteBuildTrigger. + * @param request DeleteBuildTriggerRequest message or plain object + * @returns Promise + */ + public deleteBuildTrigger(request: google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest): Promise; + + /** + * Calls UpdateBuildTrigger. + * @param request UpdateBuildTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BuildTrigger + */ + public updateBuildTrigger(request: google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.UpdateBuildTriggerCallback): void; + + /** + * Calls UpdateBuildTrigger. + * @param request UpdateBuildTriggerRequest message or plain object + * @returns Promise + */ + public updateBuildTrigger(request: google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest): Promise; + + /** + * Calls RunBuildTrigger. + * @param request RunBuildTriggerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public runBuildTrigger(request: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.RunBuildTriggerCallback): void; + + /** + * Calls RunBuildTrigger. + * @param request RunBuildTriggerRequest message or plain object + * @returns Promise + */ + public runBuildTrigger(request: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest): Promise; + + /** + * Calls ReceiveTriggerWebhook. + * @param request ReceiveTriggerWebhookRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReceiveTriggerWebhookResponse + */ + public receiveTriggerWebhook(request: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.ReceiveTriggerWebhookCallback): void; + + /** + * Calls ReceiveTriggerWebhook. + * @param request ReceiveTriggerWebhookRequest message or plain object + * @returns Promise + */ + public receiveTriggerWebhook(request: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest): Promise; + + /** + * Calls CreateWorkerPool. + * @param request CreateWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkerPool(request: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPoolCallback): void; + + /** + * Calls CreateWorkerPool. + * @param request CreateWorkerPoolRequest message or plain object + * @returns Promise + */ + public createWorkerPool(request: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest): Promise; + + /** + * Calls GetWorkerPool. + * @param request GetWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkerPool + */ + public getWorkerPool(request: google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.GetWorkerPoolCallback): void; + + /** + * Calls GetWorkerPool. + * @param request GetWorkerPoolRequest message or plain object + * @returns Promise + */ + public getWorkerPool(request: google.devtools.cloudbuild.v1.IGetWorkerPoolRequest): Promise; + + /** + * Calls DeleteWorkerPool. + * @param request DeleteWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteWorkerPool(request: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPoolCallback): void; + + /** + * Calls DeleteWorkerPool. + * @param request DeleteWorkerPoolRequest message or plain object + * @returns Promise + */ + public deleteWorkerPool(request: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest): Promise; + + /** + * Calls UpdateWorkerPool. + * @param request UpdateWorkerPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateWorkerPool(request: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPoolCallback): void; + + /** + * Calls UpdateWorkerPool. + * @param request UpdateWorkerPoolRequest message or plain object + * @returns Promise + */ + public updateWorkerPool(request: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest): Promise; + + /** + * Calls ListWorkerPools. + * @param request ListWorkerPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse + */ + public listWorkerPools(request: google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.ListWorkerPoolsCallback): void; + + /** + * Calls ListWorkerPools. + * @param request ListWorkerPoolsRequest message or plain object + * @returns Promise + */ + public listWorkerPools(request: google.devtools.cloudbuild.v1.IListWorkerPoolsRequest): Promise; + } + + namespace CloudBuild { + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|createBuild}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBuildCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|getBuild}. + * @param error Error, if any + * @param [response] Build + */ + type GetBuildCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.Build) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|listBuilds}. + * @param error Error, if any + * @param [response] ListBuildsResponse + */ + type ListBuildsCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.ListBuildsResponse) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|cancelBuild}. + * @param error Error, if any + * @param [response] Build + */ + type CancelBuildCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.Build) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|retryBuild}. + * @param error Error, if any + * @param [response] Operation + */ + type RetryBuildCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|approveBuild}. + * @param error Error, if any + * @param [response] Operation + */ + type ApproveBuildCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|createBuildTrigger}. + * @param error Error, if any + * @param [response] BuildTrigger + */ + type CreateBuildTriggerCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.BuildTrigger) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|getBuildTrigger}. + * @param error Error, if any + * @param [response] BuildTrigger + */ + type GetBuildTriggerCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.BuildTrigger) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|listBuildTriggers}. + * @param error Error, if any + * @param [response] ListBuildTriggersResponse + */ + type ListBuildTriggersCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.ListBuildTriggersResponse) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|deleteBuildTrigger}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBuildTriggerCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|updateBuildTrigger}. + * @param error Error, if any + * @param [response] BuildTrigger + */ + type UpdateBuildTriggerCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.BuildTrigger) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|runBuildTrigger}. + * @param error Error, if any + * @param [response] Operation + */ + type RunBuildTriggerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|receiveTriggerWebhook}. + * @param error Error, if any + * @param [response] ReceiveTriggerWebhookResponse + */ + type ReceiveTriggerWebhookCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|createWorkerPool}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|getWorkerPool}. + * @param error Error, if any + * @param [response] WorkerPool + */ + type GetWorkerPoolCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.WorkerPool) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|deleteWorkerPool}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|updateWorkerPool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|listWorkerPools}. + * @param error Error, if any + * @param [response] ListWorkerPoolsResponse + */ + type ListWorkerPoolsCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.ListWorkerPoolsResponse) => void; + } + + /** Properties of a RetryBuildRequest. */ + interface IRetryBuildRequest { + + /** RetryBuildRequest name */ + name?: (string|null); + + /** RetryBuildRequest projectId */ + projectId?: (string|null); + + /** RetryBuildRequest id */ + id?: (string|null); + } + + /** Represents a RetryBuildRequest. */ + class RetryBuildRequest implements IRetryBuildRequest { + + /** + * Constructs a new RetryBuildRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IRetryBuildRequest); + + /** RetryBuildRequest name. */ + public name: string; + + /** RetryBuildRequest projectId. */ + public projectId: string; + + /** RetryBuildRequest id. */ + public id: string; + + /** + * Creates a new RetryBuildRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RetryBuildRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IRetryBuildRequest): google.devtools.cloudbuild.v1.RetryBuildRequest; + + /** + * Encodes the specified RetryBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.RetryBuildRequest.verify|verify} messages. + * @param message RetryBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IRetryBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetryBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.RetryBuildRequest.verify|verify} messages. + * @param message RetryBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IRetryBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetryBuildRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetryBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.RetryBuildRequest; + + /** + * Decodes a RetryBuildRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetryBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.RetryBuildRequest; + + /** + * Verifies a RetryBuildRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetryBuildRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetryBuildRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.RetryBuildRequest; + + /** + * Creates a plain object from a RetryBuildRequest message. Also converts values to other types if specified. + * @param message RetryBuildRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.RetryBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetryBuildRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetryBuildRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RunBuildTriggerRequest. */ + interface IRunBuildTriggerRequest { + + /** RunBuildTriggerRequest name */ + name?: (string|null); + + /** RunBuildTriggerRequest projectId */ + projectId?: (string|null); + + /** RunBuildTriggerRequest triggerId */ + triggerId?: (string|null); + + /** RunBuildTriggerRequest source */ + source?: (google.devtools.cloudbuild.v1.IRepoSource|null); + } + + /** Represents a RunBuildTriggerRequest. */ + class RunBuildTriggerRequest implements IRunBuildTriggerRequest { + + /** + * Constructs a new RunBuildTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest); + + /** RunBuildTriggerRequest name. */ + public name: string; + + /** RunBuildTriggerRequest projectId. */ + public projectId: string; + + /** RunBuildTriggerRequest triggerId. */ + public triggerId: string; + + /** RunBuildTriggerRequest source. */ + public source?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** + * Creates a new RunBuildTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunBuildTriggerRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest): google.devtools.cloudbuild.v1.RunBuildTriggerRequest; + + /** + * Encodes the specified RunBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.RunBuildTriggerRequest.verify|verify} messages. + * @param message RunBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RunBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.RunBuildTriggerRequest.verify|verify} messages. + * @param message RunBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RunBuildTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.RunBuildTriggerRequest; + + /** + * Decodes a RunBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.RunBuildTriggerRequest; + + /** + * Verifies a RunBuildTriggerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RunBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunBuildTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.RunBuildTriggerRequest; + + /** + * Creates a plain object from a RunBuildTriggerRequest message. Also converts values to other types if specified. + * @param message RunBuildTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.RunBuildTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RunBuildTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RunBuildTriggerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StorageSource. */ + interface IStorageSource { + + /** StorageSource bucket */ + bucket?: (string|null); + + /** StorageSource object */ + object?: (string|null); + + /** StorageSource generation */ + generation?: (number|Long|string|null); + } + + /** Represents a StorageSource. */ + class StorageSource implements IStorageSource { + + /** + * Constructs a new StorageSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IStorageSource); + + /** StorageSource bucket. */ + public bucket: string; + + /** StorageSource object. */ + public object: string; + + /** StorageSource generation. */ + public generation: (number|Long|string); + + /** + * Creates a new StorageSource instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageSource instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IStorageSource): google.devtools.cloudbuild.v1.StorageSource; + + /** + * Encodes the specified StorageSource message. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSource.verify|verify} messages. + * @param message StorageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSource.verify|verify} messages. + * @param message StorageSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IStorageSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.StorageSource; + + /** + * Decodes a StorageSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.StorageSource; + + /** + * Verifies a StorageSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageSource + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.StorageSource; + + /** + * Creates a plain object from a StorageSource message. Also converts values to other types if specified. + * @param message StorageSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.StorageSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RepoSource. */ + interface IRepoSource { + + /** RepoSource projectId */ + projectId?: (string|null); + + /** RepoSource repoName */ + repoName?: (string|null); + + /** RepoSource branchName */ + branchName?: (string|null); + + /** RepoSource tagName */ + tagName?: (string|null); + + /** RepoSource commitSha */ + commitSha?: (string|null); + + /** RepoSource dir */ + dir?: (string|null); + + /** RepoSource invertRegex */ + invertRegex?: (boolean|null); + + /** RepoSource substitutions */ + substitutions?: ({ [k: string]: string }|null); + } + + /** Represents a RepoSource. */ + class RepoSource implements IRepoSource { + + /** + * Constructs a new RepoSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IRepoSource); + + /** RepoSource projectId. */ + public projectId: string; + + /** RepoSource repoName. */ + public repoName: string; + + /** RepoSource branchName. */ + public branchName?: (string|null); + + /** RepoSource tagName. */ + public tagName?: (string|null); + + /** RepoSource commitSha. */ + public commitSha?: (string|null); + + /** RepoSource dir. */ + public dir: string; + + /** RepoSource invertRegex. */ + public invertRegex: boolean; + + /** RepoSource substitutions. */ + public substitutions: { [k: string]: string }; + + /** RepoSource revision. */ + public revision?: ("branchName"|"tagName"|"commitSha"); + + /** + * Creates a new RepoSource instance using the specified properties. + * @param [properties] Properties to set + * @returns RepoSource instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IRepoSource): google.devtools.cloudbuild.v1.RepoSource; + + /** + * Encodes the specified RepoSource message. Does not implicitly {@link google.devtools.cloudbuild.v1.RepoSource.verify|verify} messages. + * @param message RepoSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IRepoSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepoSource message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.RepoSource.verify|verify} messages. + * @param message RepoSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IRepoSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepoSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepoSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.RepoSource; + + /** + * Decodes a RepoSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepoSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.RepoSource; + + /** + * Verifies a RepoSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepoSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepoSource + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.RepoSource; + + /** + * Creates a plain object from a RepoSource message. Also converts values to other types if specified. + * @param message RepoSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.RepoSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepoSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepoSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StorageSourceManifest. */ + interface IStorageSourceManifest { + + /** StorageSourceManifest bucket */ + bucket?: (string|null); + + /** StorageSourceManifest object */ + object?: (string|null); + + /** StorageSourceManifest generation */ + generation?: (number|Long|string|null); + } + + /** Represents a StorageSourceManifest. */ + class StorageSourceManifest implements IStorageSourceManifest { + + /** + * Constructs a new StorageSourceManifest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IStorageSourceManifest); + + /** StorageSourceManifest bucket. */ + public bucket: string; + + /** StorageSourceManifest object. */ + public object: string; + + /** StorageSourceManifest generation. */ + public generation: (number|Long|string); + + /** + * Creates a new StorageSourceManifest instance using the specified properties. + * @param [properties] Properties to set + * @returns StorageSourceManifest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IStorageSourceManifest): google.devtools.cloudbuild.v1.StorageSourceManifest; + + /** + * Encodes the specified StorageSourceManifest message. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSourceManifest.verify|verify} messages. + * @param message StorageSourceManifest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IStorageSourceManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StorageSourceManifest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSourceManifest.verify|verify} messages. + * @param message StorageSourceManifest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IStorageSourceManifest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StorageSourceManifest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StorageSourceManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.StorageSourceManifest; + + /** + * Decodes a StorageSourceManifest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StorageSourceManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.StorageSourceManifest; + + /** + * Verifies a StorageSourceManifest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StorageSourceManifest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StorageSourceManifest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.StorageSourceManifest; + + /** + * Creates a plain object from a StorageSourceManifest message. Also converts values to other types if specified. + * @param message StorageSourceManifest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.StorageSourceManifest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StorageSourceManifest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StorageSourceManifest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source storageSource */ + storageSource?: (google.devtools.cloudbuild.v1.IStorageSource|null); + + /** Source repoSource */ + repoSource?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** Source storageSourceManifest */ + storageSourceManifest?: (google.devtools.cloudbuild.v1.IStorageSourceManifest|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISource); + + /** Source storageSource. */ + public storageSource?: (google.devtools.cloudbuild.v1.IStorageSource|null); + + /** Source repoSource. */ + public repoSource?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** Source storageSourceManifest. */ + public storageSourceManifest?: (google.devtools.cloudbuild.v1.IStorageSourceManifest|null); + + /** Source source. */ + public source?: ("storageSource"|"repoSource"|"storageSourceManifest"); + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISource): google.devtools.cloudbuild.v1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.devtools.cloudbuild.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Source + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuiltImage. */ + interface IBuiltImage { + + /** BuiltImage name */ + name?: (string|null); + + /** BuiltImage digest */ + digest?: (string|null); + + /** BuiltImage pushTiming */ + pushTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + } + + /** Represents a BuiltImage. */ + class BuiltImage implements IBuiltImage { + + /** + * Constructs a new BuiltImage. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuiltImage); + + /** BuiltImage name. */ + public name: string; + + /** BuiltImage digest. */ + public digest: string; + + /** BuiltImage pushTiming. */ + public pushTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** + * Creates a new BuiltImage instance using the specified properties. + * @param [properties] Properties to set + * @returns BuiltImage instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuiltImage): google.devtools.cloudbuild.v1.BuiltImage; + + /** + * Encodes the specified BuiltImage message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuiltImage.verify|verify} messages. + * @param message BuiltImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuiltImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuiltImage message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuiltImage.verify|verify} messages. + * @param message BuiltImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuiltImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuiltImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuiltImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuiltImage; + + /** + * Decodes a BuiltImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuiltImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuiltImage; + + /** + * Verifies a BuiltImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuiltImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuiltImage + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuiltImage; + + /** + * Creates a plain object from a BuiltImage message. Also converts values to other types if specified. + * @param message BuiltImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuiltImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuiltImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuiltImage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadedPythonPackage. */ + interface IUploadedPythonPackage { + + /** UploadedPythonPackage uri */ + uri?: (string|null); + + /** UploadedPythonPackage fileHashes */ + fileHashes?: (google.devtools.cloudbuild.v1.IFileHashes|null); + + /** UploadedPythonPackage pushTiming */ + pushTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + } + + /** Represents an UploadedPythonPackage. */ + class UploadedPythonPackage implements IUploadedPythonPackage { + + /** + * Constructs a new UploadedPythonPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IUploadedPythonPackage); + + /** UploadedPythonPackage uri. */ + public uri: string; + + /** UploadedPythonPackage fileHashes. */ + public fileHashes?: (google.devtools.cloudbuild.v1.IFileHashes|null); + + /** UploadedPythonPackage pushTiming. */ + public pushTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** + * Creates a new UploadedPythonPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadedPythonPackage instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IUploadedPythonPackage): google.devtools.cloudbuild.v1.UploadedPythonPackage; + + /** + * Encodes the specified UploadedPythonPackage message. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedPythonPackage.verify|verify} messages. + * @param message UploadedPythonPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IUploadedPythonPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadedPythonPackage message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedPythonPackage.verify|verify} messages. + * @param message UploadedPythonPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IUploadedPythonPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadedPythonPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadedPythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.UploadedPythonPackage; + + /** + * Decodes an UploadedPythonPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadedPythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.UploadedPythonPackage; + + /** + * Verifies an UploadedPythonPackage message. + * @param message Plain 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 UploadedPythonPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadedPythonPackage + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.UploadedPythonPackage; + + /** + * Creates a plain object from an UploadedPythonPackage message. Also converts values to other types if specified. + * @param message UploadedPythonPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.UploadedPythonPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadedPythonPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadedPythonPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UploadedMavenArtifact. */ + interface IUploadedMavenArtifact { + + /** UploadedMavenArtifact uri */ + uri?: (string|null); + + /** UploadedMavenArtifact fileHashes */ + fileHashes?: (google.devtools.cloudbuild.v1.IFileHashes|null); + + /** UploadedMavenArtifact pushTiming */ + pushTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + } + + /** Represents an UploadedMavenArtifact. */ + class UploadedMavenArtifact implements IUploadedMavenArtifact { + + /** + * Constructs a new UploadedMavenArtifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IUploadedMavenArtifact); + + /** UploadedMavenArtifact uri. */ + public uri: string; + + /** UploadedMavenArtifact fileHashes. */ + public fileHashes?: (google.devtools.cloudbuild.v1.IFileHashes|null); + + /** UploadedMavenArtifact pushTiming. */ + public pushTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** + * Creates a new UploadedMavenArtifact instance using the specified properties. + * @param [properties] Properties to set + * @returns UploadedMavenArtifact instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IUploadedMavenArtifact): google.devtools.cloudbuild.v1.UploadedMavenArtifact; + + /** + * Encodes the specified UploadedMavenArtifact message. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedMavenArtifact.verify|verify} messages. + * @param message UploadedMavenArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IUploadedMavenArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UploadedMavenArtifact message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedMavenArtifact.verify|verify} messages. + * @param message UploadedMavenArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IUploadedMavenArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UploadedMavenArtifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UploadedMavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.UploadedMavenArtifact; + + /** + * Decodes an UploadedMavenArtifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UploadedMavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.UploadedMavenArtifact; + + /** + * Verifies an UploadedMavenArtifact message. + * @param message Plain 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 UploadedMavenArtifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UploadedMavenArtifact + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.UploadedMavenArtifact; + + /** + * Creates a plain object from an UploadedMavenArtifact message. Also converts values to other types if specified. + * @param message UploadedMavenArtifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.UploadedMavenArtifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UploadedMavenArtifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UploadedMavenArtifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildStep. */ + interface IBuildStep { + + /** BuildStep name */ + name?: (string|null); + + /** BuildStep env */ + env?: (string[]|null); + + /** BuildStep args */ + args?: (string[]|null); + + /** BuildStep dir */ + dir?: (string|null); + + /** BuildStep id */ + id?: (string|null); + + /** BuildStep waitFor */ + waitFor?: (string[]|null); + + /** BuildStep entrypoint */ + entrypoint?: (string|null); + + /** BuildStep secretEnv */ + secretEnv?: (string[]|null); + + /** BuildStep volumes */ + volumes?: (google.devtools.cloudbuild.v1.IVolume[]|null); + + /** BuildStep timing */ + timing?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** BuildStep pullTiming */ + pullTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** BuildStep timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** BuildStep status */ + status?: (google.devtools.cloudbuild.v1.Build.Status|keyof typeof google.devtools.cloudbuild.v1.Build.Status|null); + + /** BuildStep allowFailure */ + allowFailure?: (boolean|null); + + /** BuildStep exitCode */ + exitCode?: (number|null); + + /** BuildStep allowExitCodes */ + allowExitCodes?: (number[]|null); + + /** BuildStep script */ + script?: (string|null); + } + + /** Represents a BuildStep. */ + class BuildStep implements IBuildStep { + + /** + * Constructs a new BuildStep. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuildStep); + + /** BuildStep name. */ + public name: string; + + /** BuildStep env. */ + public env: string[]; + + /** BuildStep args. */ + public args: string[]; + + /** BuildStep dir. */ + public dir: string; + + /** BuildStep id. */ + public id: string; + + /** BuildStep waitFor. */ + public waitFor: string[]; + + /** BuildStep entrypoint. */ + public entrypoint: string; + + /** BuildStep secretEnv. */ + public secretEnv: string[]; + + /** BuildStep volumes. */ + public volumes: google.devtools.cloudbuild.v1.IVolume[]; + + /** BuildStep timing. */ + public timing?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** BuildStep pullTiming. */ + public pullTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** BuildStep timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** BuildStep status. */ + public status: (google.devtools.cloudbuild.v1.Build.Status|keyof typeof google.devtools.cloudbuild.v1.Build.Status); + + /** BuildStep allowFailure. */ + public allowFailure: boolean; + + /** BuildStep exitCode. */ + public exitCode: number; + + /** BuildStep allowExitCodes. */ + public allowExitCodes: number[]; + + /** BuildStep script. */ + public script: string; + + /** + * Creates a new BuildStep instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildStep instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuildStep): google.devtools.cloudbuild.v1.BuildStep; + + /** + * Encodes the specified BuildStep message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildStep.verify|verify} messages. + * @param message BuildStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuildStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildStep message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildStep.verify|verify} messages. + * @param message BuildStep message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuildStep, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildStep message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildStep; + + /** + * Decodes a BuildStep message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildStep; + + /** + * Verifies a BuildStep message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildStep message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildStep + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildStep; + + /** + * Creates a plain object from a BuildStep message. Also converts values to other types if specified. + * @param message BuildStep + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildStep, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildStep to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildStep + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Volume. */ + interface IVolume { + + /** Volume name */ + name?: (string|null); + + /** Volume path */ + path?: (string|null); + } + + /** Represents a Volume. */ + class Volume implements IVolume { + + /** + * Constructs a new Volume. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IVolume); + + /** Volume name. */ + public name: string; + + /** Volume path. */ + public path: string; + + /** + * Creates a new Volume instance using the specified properties. + * @param [properties] Properties to set + * @returns Volume instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IVolume): google.devtools.cloudbuild.v1.Volume; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.devtools.cloudbuild.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Volume.verify|verify} messages. + * @param message Volume message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IVolume, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Volume; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Volume; + + /** + * Verifies a Volume message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Volume + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Volume; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @param message Volume + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Volume, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Volume to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Volume + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Results. */ + interface IResults { + + /** Results images */ + images?: (google.devtools.cloudbuild.v1.IBuiltImage[]|null); + + /** Results buildStepImages */ + buildStepImages?: (string[]|null); + + /** Results artifactManifest */ + artifactManifest?: (string|null); + + /** Results numArtifacts */ + numArtifacts?: (number|Long|string|null); + + /** Results buildStepOutputs */ + buildStepOutputs?: (Uint8Array[]|null); + + /** Results artifactTiming */ + artifactTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** Results pythonPackages */ + pythonPackages?: (google.devtools.cloudbuild.v1.IUploadedPythonPackage[]|null); + + /** Results mavenArtifacts */ + mavenArtifacts?: (google.devtools.cloudbuild.v1.IUploadedMavenArtifact[]|null); + } + + /** Represents a Results. */ + class Results implements IResults { + + /** + * Constructs a new Results. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IResults); + + /** Results images. */ + public images: google.devtools.cloudbuild.v1.IBuiltImage[]; + + /** Results buildStepImages. */ + public buildStepImages: string[]; + + /** Results artifactManifest. */ + public artifactManifest: string; + + /** Results numArtifacts. */ + public numArtifacts: (number|Long|string); + + /** Results buildStepOutputs. */ + public buildStepOutputs: Uint8Array[]; + + /** Results artifactTiming. */ + public artifactTiming?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** Results pythonPackages. */ + public pythonPackages: google.devtools.cloudbuild.v1.IUploadedPythonPackage[]; + + /** Results mavenArtifacts. */ + public mavenArtifacts: google.devtools.cloudbuild.v1.IUploadedMavenArtifact[]; + + /** + * Creates a new Results instance using the specified properties. + * @param [properties] Properties to set + * @returns Results instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IResults): google.devtools.cloudbuild.v1.Results; + + /** + * Encodes the specified Results message. Does not implicitly {@link google.devtools.cloudbuild.v1.Results.verify|verify} messages. + * @param message Results message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Results message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Results.verify|verify} messages. + * @param message Results message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Results message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Results + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Results; + + /** + * Decodes a Results message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Results + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Results; + + /** + * Verifies a Results message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Results message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Results + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Results; + + /** + * Creates a plain object from a Results message. Also converts values to other types if specified. + * @param message Results + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Results, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Results to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Results + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ArtifactResult. */ + interface IArtifactResult { + + /** ArtifactResult location */ + location?: (string|null); + + /** ArtifactResult fileHash */ + fileHash?: (google.devtools.cloudbuild.v1.IFileHashes[]|null); + } + + /** Represents an ArtifactResult. */ + class ArtifactResult implements IArtifactResult { + + /** + * Constructs a new ArtifactResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IArtifactResult); + + /** ArtifactResult location. */ + public location: string; + + /** ArtifactResult fileHash. */ + public fileHash: google.devtools.cloudbuild.v1.IFileHashes[]; + + /** + * Creates a new ArtifactResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ArtifactResult instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IArtifactResult): google.devtools.cloudbuild.v1.ArtifactResult; + + /** + * Encodes the specified ArtifactResult message. Does not implicitly {@link google.devtools.cloudbuild.v1.ArtifactResult.verify|verify} messages. + * @param message ArtifactResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IArtifactResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArtifactResult message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ArtifactResult.verify|verify} messages. + * @param message ArtifactResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IArtifactResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArtifactResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArtifactResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ArtifactResult; + + /** + * Decodes an ArtifactResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArtifactResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ArtifactResult; + + /** + * Verifies an ArtifactResult message. + * @param message Plain 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 ArtifactResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArtifactResult + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ArtifactResult; + + /** + * Creates a plain object from an ArtifactResult message. Also converts values to other types if specified. + * @param message ArtifactResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ArtifactResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArtifactResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArtifactResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Build. */ + interface IBuild { + + /** Build name */ + name?: (string|null); + + /** Build id */ + id?: (string|null); + + /** Build projectId */ + projectId?: (string|null); + + /** Build status */ + status?: (google.devtools.cloudbuild.v1.Build.Status|keyof typeof google.devtools.cloudbuild.v1.Build.Status|null); + + /** Build statusDetail */ + statusDetail?: (string|null); + + /** Build source */ + source?: (google.devtools.cloudbuild.v1.ISource|null); + + /** Build steps */ + steps?: (google.devtools.cloudbuild.v1.IBuildStep[]|null); + + /** Build results */ + results?: (google.devtools.cloudbuild.v1.IResults|null); + + /** Build createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Build startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Build finishTime */ + finishTime?: (google.protobuf.ITimestamp|null); + + /** Build timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** Build images */ + images?: (string[]|null); + + /** Build queueTtl */ + queueTtl?: (google.protobuf.IDuration|null); + + /** Build artifacts */ + artifacts?: (google.devtools.cloudbuild.v1.IArtifacts|null); + + /** Build logsBucket */ + logsBucket?: (string|null); + + /** Build sourceProvenance */ + sourceProvenance?: (google.devtools.cloudbuild.v1.ISourceProvenance|null); + + /** Build buildTriggerId */ + buildTriggerId?: (string|null); + + /** Build options */ + options?: (google.devtools.cloudbuild.v1.IBuildOptions|null); + + /** Build logUrl */ + logUrl?: (string|null); + + /** Build substitutions */ + substitutions?: ({ [k: string]: string }|null); + + /** Build tags */ + tags?: (string[]|null); + + /** Build secrets */ + secrets?: (google.devtools.cloudbuild.v1.ISecret[]|null); + + /** Build timing */ + timing?: ({ [k: string]: google.devtools.cloudbuild.v1.ITimeSpan }|null); + + /** Build approval */ + approval?: (google.devtools.cloudbuild.v1.IBuildApproval|null); + + /** Build serviceAccount */ + serviceAccount?: (string|null); + + /** Build availableSecrets */ + availableSecrets?: (google.devtools.cloudbuild.v1.ISecrets|null); + + /** Build warnings */ + warnings?: (google.devtools.cloudbuild.v1.Build.IWarning[]|null); + + /** Build failureInfo */ + failureInfo?: (google.devtools.cloudbuild.v1.Build.IFailureInfo|null); + } + + /** Represents a Build. */ + class Build implements IBuild { + + /** + * Constructs a new Build. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuild); + + /** Build name. */ + public name: string; + + /** Build id. */ + public id: string; + + /** Build projectId. */ + public projectId: string; + + /** Build status. */ + public status: (google.devtools.cloudbuild.v1.Build.Status|keyof typeof google.devtools.cloudbuild.v1.Build.Status); + + /** Build statusDetail. */ + public statusDetail: string; + + /** Build source. */ + public source?: (google.devtools.cloudbuild.v1.ISource|null); + + /** Build steps. */ + public steps: google.devtools.cloudbuild.v1.IBuildStep[]; + + /** Build results. */ + public results?: (google.devtools.cloudbuild.v1.IResults|null); + + /** Build createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Build startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Build finishTime. */ + public finishTime?: (google.protobuf.ITimestamp|null); + + /** Build timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** Build images. */ + public images: string[]; + + /** Build queueTtl. */ + public queueTtl?: (google.protobuf.IDuration|null); + + /** Build artifacts. */ + public artifacts?: (google.devtools.cloudbuild.v1.IArtifacts|null); + + /** Build logsBucket. */ + public logsBucket: string; + + /** Build sourceProvenance. */ + public sourceProvenance?: (google.devtools.cloudbuild.v1.ISourceProvenance|null); + + /** Build buildTriggerId. */ + public buildTriggerId: string; + + /** Build options. */ + public options?: (google.devtools.cloudbuild.v1.IBuildOptions|null); + + /** Build logUrl. */ + public logUrl: string; + + /** Build substitutions. */ + public substitutions: { [k: string]: string }; + + /** Build tags. */ + public tags: string[]; + + /** Build secrets. */ + public secrets: google.devtools.cloudbuild.v1.ISecret[]; + + /** Build timing. */ + public timing: { [k: string]: google.devtools.cloudbuild.v1.ITimeSpan }; + + /** Build approval. */ + public approval?: (google.devtools.cloudbuild.v1.IBuildApproval|null); + + /** Build serviceAccount. */ + public serviceAccount: string; + + /** Build availableSecrets. */ + public availableSecrets?: (google.devtools.cloudbuild.v1.ISecrets|null); + + /** Build warnings. */ + public warnings: google.devtools.cloudbuild.v1.Build.IWarning[]; + + /** Build failureInfo. */ + public failureInfo?: (google.devtools.cloudbuild.v1.Build.IFailureInfo|null); + + /** + * Creates a new Build instance using the specified properties. + * @param [properties] Properties to set + * @returns Build instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuild): google.devtools.cloudbuild.v1.Build; + + /** + * Encodes the specified Build message. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.verify|verify} messages. + * @param message Build message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuild, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Build message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.verify|verify} messages. + * @param message Build message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuild, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Build message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Build + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Build; + + /** + * Decodes a Build message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Build + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Build; + + /** + * Verifies a Build message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Build message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Build + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Build; + + /** + * Creates a plain object from a Build message. Also converts values to other types if specified. + * @param message Build + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Build, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Build to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Build + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Build { + + /** Properties of a Warning. */ + interface IWarning { + + /** Warning text */ + text?: (string|null); + + /** Warning priority */ + priority?: (google.devtools.cloudbuild.v1.Build.Warning.Priority|keyof typeof google.devtools.cloudbuild.v1.Build.Warning.Priority|null); + } + + /** Represents a Warning. */ + class Warning implements IWarning { + + /** + * Constructs a new Warning. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.Build.IWarning); + + /** Warning text. */ + public text: string; + + /** Warning priority. */ + public priority: (google.devtools.cloudbuild.v1.Build.Warning.Priority|keyof typeof google.devtools.cloudbuild.v1.Build.Warning.Priority); + + /** + * Creates a new Warning instance using the specified properties. + * @param [properties] Properties to set + * @returns Warning instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.Build.IWarning): google.devtools.cloudbuild.v1.Build.Warning; + + /** + * Encodes the specified Warning message. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.Warning.verify|verify} messages. + * @param message Warning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.Build.IWarning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Warning message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.Warning.verify|verify} messages. + * @param message Warning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.Build.IWarning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Warning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Build.Warning; + + /** + * Decodes a Warning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Build.Warning; + + /** + * Verifies a Warning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Warning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Warning + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Build.Warning; + + /** + * Creates a plain object from a Warning message. Also converts values to other types if specified. + * @param message Warning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Build.Warning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Warning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Warning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Warning { + + /** Priority enum. */ + enum Priority { + PRIORITY_UNSPECIFIED = 0, + INFO = 1, + WARNING = 2, + ALERT = 3 + } + } + + /** Properties of a FailureInfo. */ + interface IFailureInfo { + + /** FailureInfo type */ + type?: (google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType|keyof typeof google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType|null); + + /** FailureInfo detail */ + detail?: (string|null); + } + + /** Represents a FailureInfo. */ + class FailureInfo implements IFailureInfo { + + /** + * Constructs a new FailureInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.Build.IFailureInfo); + + /** FailureInfo type. */ + public type: (google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType|keyof typeof google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType); + + /** FailureInfo detail. */ + public detail: string; + + /** + * Creates a new FailureInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FailureInfo instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.Build.IFailureInfo): google.devtools.cloudbuild.v1.Build.FailureInfo; + + /** + * Encodes the specified FailureInfo message. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.FailureInfo.verify|verify} messages. + * @param message FailureInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.Build.IFailureInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FailureInfo message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.FailureInfo.verify|verify} messages. + * @param message FailureInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.Build.IFailureInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FailureInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FailureInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Build.FailureInfo; + + /** + * Decodes a FailureInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FailureInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Build.FailureInfo; + + /** + * Verifies a FailureInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FailureInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FailureInfo + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Build.FailureInfo; + + /** + * Creates a plain object from a FailureInfo message. Also converts values to other types if specified. + * @param message FailureInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Build.FailureInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FailureInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FailureInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FailureInfo { + + /** FailureType enum. */ + enum FailureType { + FAILURE_TYPE_UNSPECIFIED = 0, + PUSH_FAILED = 1, + PUSH_IMAGE_NOT_FOUND = 2, + PUSH_NOT_AUTHORIZED = 3, + LOGGING_FAILURE = 4, + USER_BUILD_STEP = 5, + FETCH_SOURCE_FAILED = 6 + } + } + + /** Status enum. */ + enum Status { + STATUS_UNKNOWN = 0, + PENDING = 10, + QUEUED = 1, + WORKING = 2, + SUCCESS = 3, + FAILURE = 4, + INTERNAL_ERROR = 5, + TIMEOUT = 6, + CANCELLED = 7, + EXPIRED = 9 + } + } + + /** Properties of an Artifacts. */ + interface IArtifacts { + + /** Artifacts images */ + images?: (string[]|null); + + /** Artifacts objects */ + objects?: (google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects|null); + + /** Artifacts mavenArtifacts */ + mavenArtifacts?: (google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact[]|null); + + /** Artifacts pythonPackages */ + pythonPackages?: (google.devtools.cloudbuild.v1.Artifacts.IPythonPackage[]|null); + } + + /** Represents an Artifacts. */ + class Artifacts implements IArtifacts { + + /** + * Constructs a new Artifacts. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IArtifacts); + + /** Artifacts images. */ + public images: string[]; + + /** Artifacts objects. */ + public objects?: (google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects|null); + + /** Artifacts mavenArtifacts. */ + public mavenArtifacts: google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact[]; + + /** Artifacts pythonPackages. */ + public pythonPackages: google.devtools.cloudbuild.v1.Artifacts.IPythonPackage[]; + + /** + * Creates a new Artifacts instance using the specified properties. + * @param [properties] Properties to set + * @returns Artifacts instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IArtifacts): google.devtools.cloudbuild.v1.Artifacts; + + /** + * Encodes the specified Artifacts message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.verify|verify} messages. + * @param message Artifacts message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IArtifacts, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Artifacts message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.verify|verify} messages. + * @param message Artifacts message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IArtifacts, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Artifacts message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Artifacts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Artifacts; + + /** + * Decodes an Artifacts message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Artifacts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Artifacts; + + /** + * Verifies an Artifacts message. + * @param message Plain 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 Artifacts message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Artifacts + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Artifacts; + + /** + * Creates a plain object from an Artifacts message. Also converts values to other types if specified. + * @param message Artifacts + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Artifacts, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Artifacts to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Artifacts + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Artifacts { + + /** Properties of an ArtifactObjects. */ + interface IArtifactObjects { + + /** ArtifactObjects location */ + location?: (string|null); + + /** ArtifactObjects paths */ + paths?: (string[]|null); + + /** ArtifactObjects timing */ + timing?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + } + + /** Represents an ArtifactObjects. */ + class ArtifactObjects implements IArtifactObjects { + + /** + * Constructs a new ArtifactObjects. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects); + + /** ArtifactObjects location. */ + public location: string; + + /** ArtifactObjects paths. */ + public paths: string[]; + + /** ArtifactObjects timing. */ + public timing?: (google.devtools.cloudbuild.v1.ITimeSpan|null); + + /** + * Creates a new ArtifactObjects instance using the specified properties. + * @param [properties] Properties to set + * @returns ArtifactObjects instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects): google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects; + + /** + * Encodes the specified ArtifactObjects message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.verify|verify} messages. + * @param message ArtifactObjects message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArtifactObjects message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.verify|verify} messages. + * @param message ArtifactObjects message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArtifactObjects message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArtifactObjects + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects; + + /** + * Decodes an ArtifactObjects message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArtifactObjects + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects; + + /** + * Verifies an ArtifactObjects message. + * @param message Plain 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 ArtifactObjects message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArtifactObjects + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects; + + /** + * Creates a plain object from an ArtifactObjects message. Also converts values to other types if specified. + * @param message ArtifactObjects + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArtifactObjects to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArtifactObjects + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MavenArtifact. */ + interface IMavenArtifact { + + /** MavenArtifact repository */ + repository?: (string|null); + + /** MavenArtifact path */ + path?: (string|null); + + /** MavenArtifact artifactId */ + artifactId?: (string|null); + + /** MavenArtifact groupId */ + groupId?: (string|null); + + /** MavenArtifact version */ + version?: (string|null); + } + + /** Represents a MavenArtifact. */ + class MavenArtifact implements IMavenArtifact { + + /** + * Constructs a new MavenArtifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact); + + /** MavenArtifact repository. */ + public repository: string; + + /** MavenArtifact path. */ + public path: string; + + /** MavenArtifact artifactId. */ + public artifactId: string; + + /** MavenArtifact groupId. */ + public groupId: string; + + /** MavenArtifact version. */ + public version: string; + + /** + * Creates a new MavenArtifact instance using the specified properties. + * @param [properties] Properties to set + * @returns MavenArtifact instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact): google.devtools.cloudbuild.v1.Artifacts.MavenArtifact; + + /** + * Encodes the specified MavenArtifact message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.verify|verify} messages. + * @param message MavenArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MavenArtifact message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.verify|verify} messages. + * @param message MavenArtifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MavenArtifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Artifacts.MavenArtifact; + + /** + * Decodes a MavenArtifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Artifacts.MavenArtifact; + + /** + * Verifies a MavenArtifact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MavenArtifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MavenArtifact + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Artifacts.MavenArtifact; + + /** + * Creates a plain object from a MavenArtifact message. Also converts values to other types if specified. + * @param message MavenArtifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Artifacts.MavenArtifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MavenArtifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MavenArtifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonPackage. */ + interface IPythonPackage { + + /** PythonPackage repository */ + repository?: (string|null); + + /** PythonPackage paths */ + paths?: (string[]|null); + } + + /** Represents a PythonPackage. */ + class PythonPackage implements IPythonPackage { + + /** + * Constructs a new PythonPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.Artifacts.IPythonPackage); + + /** PythonPackage repository. */ + public repository: string; + + /** PythonPackage paths. */ + public paths: string[]; + + /** + * Creates a new PythonPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonPackage instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.Artifacts.IPythonPackage): google.devtools.cloudbuild.v1.Artifacts.PythonPackage; + + /** + * Encodes the specified PythonPackage message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.PythonPackage.verify|verify} messages. + * @param message PythonPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.Artifacts.IPythonPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonPackage message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.PythonPackage.verify|verify} messages. + * @param message PythonPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.Artifacts.IPythonPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Artifacts.PythonPackage; + + /** + * Decodes a PythonPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Artifacts.PythonPackage; + + /** + * Verifies a PythonPackage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonPackage + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Artifacts.PythonPackage; + + /** + * Creates a plain object from a PythonPackage message. Also converts values to other types if specified. + * @param message PythonPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Artifacts.PythonPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a TimeSpan. */ + interface ITimeSpan { + + /** TimeSpan startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeSpan endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeSpan. */ + class TimeSpan implements ITimeSpan { + + /** + * Constructs a new TimeSpan. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ITimeSpan); + + /** TimeSpan startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeSpan endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeSpan instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSpan instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ITimeSpan): google.devtools.cloudbuild.v1.TimeSpan; + + /** + * Encodes the specified TimeSpan message. Does not implicitly {@link google.devtools.cloudbuild.v1.TimeSpan.verify|verify} messages. + * @param message TimeSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ITimeSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSpan message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.TimeSpan.verify|verify} messages. + * @param message TimeSpan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ITimeSpan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSpan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.TimeSpan; + + /** + * Decodes a TimeSpan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.TimeSpan; + + /** + * Verifies a TimeSpan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSpan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSpan + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.TimeSpan; + + /** + * Creates a plain object from a TimeSpan message. Also converts values to other types if specified. + * @param message TimeSpan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.TimeSpan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSpan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSpan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildOperationMetadata. */ + interface IBuildOperationMetadata { + + /** BuildOperationMetadata build */ + build?: (google.devtools.cloudbuild.v1.IBuild|null); + } + + /** Represents a BuildOperationMetadata. */ + class BuildOperationMetadata implements IBuildOperationMetadata { + + /** + * Constructs a new BuildOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuildOperationMetadata); + + /** BuildOperationMetadata build. */ + public build?: (google.devtools.cloudbuild.v1.IBuild|null); + + /** + * Creates a new BuildOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuildOperationMetadata): google.devtools.cloudbuild.v1.BuildOperationMetadata; + + /** + * Encodes the specified BuildOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOperationMetadata.verify|verify} messages. + * @param message BuildOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuildOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOperationMetadata.verify|verify} messages. + * @param message BuildOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuildOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildOperationMetadata; + + /** + * Decodes a BuildOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildOperationMetadata; + + /** + * Verifies a BuildOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildOperationMetadata; + + /** + * Creates a plain object from a BuildOperationMetadata message. Also converts values to other types if specified. + * @param message BuildOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SourceProvenance. */ + interface ISourceProvenance { + + /** SourceProvenance resolvedStorageSource */ + resolvedStorageSource?: (google.devtools.cloudbuild.v1.IStorageSource|null); + + /** SourceProvenance resolvedRepoSource */ + resolvedRepoSource?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** SourceProvenance resolvedStorageSourceManifest */ + resolvedStorageSourceManifest?: (google.devtools.cloudbuild.v1.IStorageSourceManifest|null); + + /** SourceProvenance fileHashes */ + fileHashes?: ({ [k: string]: google.devtools.cloudbuild.v1.IFileHashes }|null); + } + + /** Represents a SourceProvenance. */ + class SourceProvenance implements ISourceProvenance { + + /** + * Constructs a new SourceProvenance. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISourceProvenance); + + /** SourceProvenance resolvedStorageSource. */ + public resolvedStorageSource?: (google.devtools.cloudbuild.v1.IStorageSource|null); + + /** SourceProvenance resolvedRepoSource. */ + public resolvedRepoSource?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** SourceProvenance resolvedStorageSourceManifest. */ + public resolvedStorageSourceManifest?: (google.devtools.cloudbuild.v1.IStorageSourceManifest|null); + + /** SourceProvenance fileHashes. */ + public fileHashes: { [k: string]: google.devtools.cloudbuild.v1.IFileHashes }; + + /** + * Creates a new SourceProvenance instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceProvenance instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISourceProvenance): google.devtools.cloudbuild.v1.SourceProvenance; + + /** + * Encodes the specified SourceProvenance message. Does not implicitly {@link google.devtools.cloudbuild.v1.SourceProvenance.verify|verify} messages. + * @param message SourceProvenance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISourceProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceProvenance message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.SourceProvenance.verify|verify} messages. + * @param message SourceProvenance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISourceProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceProvenance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.SourceProvenance; + + /** + * Decodes a SourceProvenance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.SourceProvenance; + + /** + * Verifies a SourceProvenance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceProvenance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceProvenance + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.SourceProvenance; + + /** + * Creates a plain object from a SourceProvenance message. Also converts values to other types if specified. + * @param message SourceProvenance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.SourceProvenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceProvenance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceProvenance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileHashes. */ + interface IFileHashes { + + /** FileHashes fileHash */ + fileHash?: (google.devtools.cloudbuild.v1.IHash[]|null); + } + + /** Represents a FileHashes. */ + class FileHashes implements IFileHashes { + + /** + * Constructs a new FileHashes. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IFileHashes); + + /** FileHashes fileHash. */ + public fileHash: google.devtools.cloudbuild.v1.IHash[]; + + /** + * Creates a new FileHashes instance using the specified properties. + * @param [properties] Properties to set + * @returns FileHashes instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IFileHashes): google.devtools.cloudbuild.v1.FileHashes; + + /** + * Encodes the specified FileHashes message. Does not implicitly {@link google.devtools.cloudbuild.v1.FileHashes.verify|verify} messages. + * @param message FileHashes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IFileHashes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileHashes message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.FileHashes.verify|verify} messages. + * @param message FileHashes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IFileHashes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileHashes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.FileHashes; + + /** + * Decodes a FileHashes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.FileHashes; + + /** + * Verifies a FileHashes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileHashes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileHashes + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.FileHashes; + + /** + * Creates a plain object from a FileHashes message. Also converts values to other types if specified. + * @param message FileHashes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.FileHashes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileHashes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileHashes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Hash. */ + interface IHash { + + /** Hash type */ + type?: (google.devtools.cloudbuild.v1.Hash.HashType|keyof typeof google.devtools.cloudbuild.v1.Hash.HashType|null); + + /** Hash value */ + value?: (Uint8Array|string|null); + } + + /** Represents a Hash. */ + class Hash implements IHash { + + /** + * Constructs a new Hash. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IHash); + + /** Hash type. */ + public type: (google.devtools.cloudbuild.v1.Hash.HashType|keyof typeof google.devtools.cloudbuild.v1.Hash.HashType); + + /** Hash value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Hash instance using the specified properties. + * @param [properties] Properties to set + * @returns Hash instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IHash): google.devtools.cloudbuild.v1.Hash; + + /** + * Encodes the specified Hash message. Does not implicitly {@link google.devtools.cloudbuild.v1.Hash.verify|verify} messages. + * @param message Hash message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IHash, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hash message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Hash.verify|verify} messages. + * @param message Hash message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IHash, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hash message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Hash; + + /** + * Decodes a Hash message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Hash; + + /** + * Verifies a Hash message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hash message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hash + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Hash; + + /** + * Creates a plain object from a Hash message. Also converts values to other types if specified. + * @param message Hash + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Hash, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hash to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hash + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Hash { + + /** HashType enum. */ + enum HashType { + NONE = 0, + SHA256 = 1, + MD5 = 2 + } + } + + /** Properties of a Secrets. */ + interface ISecrets { + + /** Secrets secretManager */ + secretManager?: (google.devtools.cloudbuild.v1.ISecretManagerSecret[]|null); + + /** Secrets inline */ + inline?: (google.devtools.cloudbuild.v1.IInlineSecret[]|null); + } + + /** Represents a Secrets. */ + class Secrets implements ISecrets { + + /** + * Constructs a new Secrets. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISecrets); + + /** Secrets secretManager. */ + public secretManager: google.devtools.cloudbuild.v1.ISecretManagerSecret[]; + + /** Secrets inline. */ + public inline: google.devtools.cloudbuild.v1.IInlineSecret[]; + + /** + * Creates a new Secrets instance using the specified properties. + * @param [properties] Properties to set + * @returns Secrets instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISecrets): google.devtools.cloudbuild.v1.Secrets; + + /** + * Encodes the specified Secrets message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. + * @param message Secrets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISecrets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Secrets message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. + * @param message Secrets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISecrets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Secrets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Secrets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Secrets; + + /** + * Decodes a Secrets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Secrets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Secrets; + + /** + * Verifies a Secrets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Secrets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Secrets + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Secrets; + + /** + * Creates a plain object from a Secrets message. Also converts values to other types if specified. + * @param message Secrets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Secrets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Secrets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Secrets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InlineSecret. */ + interface IInlineSecret { + + /** InlineSecret kmsKeyName */ + kmsKeyName?: (string|null); + + /** InlineSecret envMap */ + envMap?: ({ [k: string]: Uint8Array }|null); + } + + /** Represents an InlineSecret. */ + class InlineSecret implements IInlineSecret { + + /** + * Constructs a new InlineSecret. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IInlineSecret); + + /** InlineSecret kmsKeyName. */ + public kmsKeyName: string; + + /** InlineSecret envMap. */ + public envMap: { [k: string]: Uint8Array }; + + /** + * Creates a new InlineSecret instance using the specified properties. + * @param [properties] Properties to set + * @returns InlineSecret instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IInlineSecret): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Encodes the specified InlineSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. + * @param message InlineSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IInlineSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InlineSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. + * @param message InlineSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IInlineSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InlineSecret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InlineSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Decodes an InlineSecret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InlineSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Verifies an InlineSecret message. + * @param message Plain 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 InlineSecret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InlineSecret + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.InlineSecret; + + /** + * Creates a plain object from an InlineSecret message. Also converts values to other types if specified. + * @param message InlineSecret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.InlineSecret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InlineSecret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InlineSecret + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecretManagerSecret. */ + interface ISecretManagerSecret { + + /** SecretManagerSecret versionName */ + versionName?: (string|null); + + /** SecretManagerSecret env */ + env?: (string|null); + } + + /** Represents a SecretManagerSecret. */ + class SecretManagerSecret implements ISecretManagerSecret { + + /** + * Constructs a new SecretManagerSecret. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISecretManagerSecret); + + /** SecretManagerSecret versionName. */ + public versionName: string; + + /** SecretManagerSecret env. */ + public env: string; + + /** + * Creates a new SecretManagerSecret instance using the specified properties. + * @param [properties] Properties to set + * @returns SecretManagerSecret instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISecretManagerSecret): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Encodes the specified SecretManagerSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. + * @param message SecretManagerSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISecretManagerSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecretManagerSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. + * @param message SecretManagerSecret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISecretManagerSecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecretManagerSecret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecretManagerSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Decodes a SecretManagerSecret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecretManagerSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Verifies a SecretManagerSecret message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecretManagerSecret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecretManagerSecret + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.SecretManagerSecret; + + /** + * Creates a plain object from a SecretManagerSecret message. Also converts values to other types if specified. + * @param message SecretManagerSecret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.SecretManagerSecret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecretManagerSecret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecretManagerSecret + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Secret. */ + interface ISecret { + + /** Secret kmsKeyName */ + kmsKeyName?: (string|null); + + /** Secret secretEnv */ + secretEnv?: ({ [k: string]: Uint8Array }|null); + } + + /** Represents a Secret. */ + class Secret implements ISecret { + + /** + * Constructs a new Secret. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ISecret); + + /** Secret kmsKeyName. */ + public kmsKeyName: string; + + /** Secret secretEnv. */ + public secretEnv: { [k: string]: Uint8Array }; + + /** + * Creates a new Secret instance using the specified properties. + * @param [properties] Properties to set + * @returns Secret instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ISecret): google.devtools.cloudbuild.v1.Secret; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. + * @param message Secret message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ISecret, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.Secret; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.Secret; + + /** + * Verifies a Secret message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Secret + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.Secret; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @param message Secret + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.Secret, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Secret to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Secret + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBuildRequest. */ + interface ICreateBuildRequest { + + /** CreateBuildRequest parent */ + parent?: (string|null); + + /** CreateBuildRequest projectId */ + projectId?: (string|null); + + /** CreateBuildRequest build */ + build?: (google.devtools.cloudbuild.v1.IBuild|null); + } + + /** Represents a CreateBuildRequest. */ + class CreateBuildRequest implements ICreateBuildRequest { + + /** + * Constructs a new CreateBuildRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ICreateBuildRequest); + + /** CreateBuildRequest parent. */ + public parent: string; + + /** CreateBuildRequest projectId. */ + public projectId: string; + + /** CreateBuildRequest build. */ + public build?: (google.devtools.cloudbuild.v1.IBuild|null); + + /** + * Creates a new CreateBuildRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBuildRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ICreateBuildRequest): google.devtools.cloudbuild.v1.CreateBuildRequest; + + /** + * Encodes the specified CreateBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. + * @param message CreateBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ICreateBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. + * @param message CreateBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ICreateBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBuildRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.CreateBuildRequest; + + /** + * Decodes a CreateBuildRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.CreateBuildRequest; + + /** + * Verifies a CreateBuildRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBuildRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBuildRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.CreateBuildRequest; + + /** + * Creates a plain object from a CreateBuildRequest message. Also converts values to other types if specified. + * @param message CreateBuildRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.CreateBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBuildRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBuildRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBuildRequest. */ + interface IGetBuildRequest { + + /** GetBuildRequest name */ + name?: (string|null); + + /** GetBuildRequest projectId */ + projectId?: (string|null); + + /** GetBuildRequest id */ + id?: (string|null); + } + + /** Represents a GetBuildRequest. */ + class GetBuildRequest implements IGetBuildRequest { + + /** + * Constructs a new GetBuildRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IGetBuildRequest); + + /** GetBuildRequest name. */ + public name: string; + + /** GetBuildRequest projectId. */ + public projectId: string; + + /** GetBuildRequest id. */ + public id: string; + + /** + * Creates a new GetBuildRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBuildRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IGetBuildRequest): google.devtools.cloudbuild.v1.GetBuildRequest; + + /** + * Encodes the specified GetBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. + * @param message GetBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IGetBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. + * @param message GetBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IGetBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBuildRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.GetBuildRequest; + + /** + * Decodes a GetBuildRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.GetBuildRequest; + + /** + * Verifies a GetBuildRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBuildRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBuildRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.GetBuildRequest; + + /** + * Creates a plain object from a GetBuildRequest message. Also converts values to other types if specified. + * @param message GetBuildRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.GetBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBuildRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBuildRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBuildsRequest. */ + interface IListBuildsRequest { + + /** ListBuildsRequest parent */ + parent?: (string|null); + + /** ListBuildsRequest projectId */ + projectId?: (string|null); + + /** ListBuildsRequest pageSize */ + pageSize?: (number|null); + + /** ListBuildsRequest pageToken */ + pageToken?: (string|null); + + /** ListBuildsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBuildsRequest. */ + class ListBuildsRequest implements IListBuildsRequest { + + /** + * Constructs a new ListBuildsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IListBuildsRequest); + + /** ListBuildsRequest parent. */ + public parent: string; + + /** ListBuildsRequest projectId. */ + public projectId: string; + + /** ListBuildsRequest pageSize. */ + public pageSize: number; + + /** ListBuildsRequest pageToken. */ + public pageToken: string; + + /** ListBuildsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBuildsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBuildsRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IListBuildsRequest): google.devtools.cloudbuild.v1.ListBuildsRequest; + + /** + * Encodes the specified ListBuildsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. + * @param message ListBuildsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IListBuildsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBuildsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. + * @param message ListBuildsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IListBuildsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBuildsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBuildsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ListBuildsRequest; + + /** + * Decodes a ListBuildsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBuildsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ListBuildsRequest; + + /** + * Verifies a ListBuildsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBuildsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBuildsRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ListBuildsRequest; + + /** + * Creates a plain object from a ListBuildsRequest message. Also converts values to other types if specified. + * @param message ListBuildsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ListBuildsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBuildsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBuildsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBuildsResponse. */ + interface IListBuildsResponse { + + /** ListBuildsResponse builds */ + builds?: (google.devtools.cloudbuild.v1.IBuild[]|null); + + /** ListBuildsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBuildsResponse. */ + class ListBuildsResponse implements IListBuildsResponse { + + /** + * Constructs a new ListBuildsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IListBuildsResponse); + + /** ListBuildsResponse builds. */ + public builds: google.devtools.cloudbuild.v1.IBuild[]; + + /** ListBuildsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBuildsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBuildsResponse instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IListBuildsResponse): google.devtools.cloudbuild.v1.ListBuildsResponse; + + /** + * Encodes the specified ListBuildsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. + * @param message ListBuildsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IListBuildsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBuildsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. + * @param message ListBuildsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IListBuildsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBuildsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBuildsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ListBuildsResponse; + + /** + * Decodes a ListBuildsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBuildsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ListBuildsResponse; + + /** + * Verifies a ListBuildsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBuildsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBuildsResponse + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ListBuildsResponse; + + /** + * Creates a plain object from a ListBuildsResponse message. Also converts values to other types if specified. + * @param message ListBuildsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ListBuildsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBuildsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBuildsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelBuildRequest. */ + interface ICancelBuildRequest { + + /** CancelBuildRequest name */ + name?: (string|null); + + /** CancelBuildRequest projectId */ + projectId?: (string|null); + + /** CancelBuildRequest id */ + id?: (string|null); + } + + /** Represents a CancelBuildRequest. */ + class CancelBuildRequest implements ICancelBuildRequest { + + /** + * Constructs a new CancelBuildRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ICancelBuildRequest); + + /** CancelBuildRequest name. */ + public name: string; + + /** CancelBuildRequest projectId. */ + public projectId: string; + + /** CancelBuildRequest id. */ + public id: string; + + /** + * Creates a new CancelBuildRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelBuildRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ICancelBuildRequest): google.devtools.cloudbuild.v1.CancelBuildRequest; + + /** + * Encodes the specified CancelBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. + * @param message CancelBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ICancelBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. + * @param message CancelBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ICancelBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelBuildRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.CancelBuildRequest; + + /** + * Decodes a CancelBuildRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.CancelBuildRequest; + + /** + * Verifies a CancelBuildRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelBuildRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelBuildRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.CancelBuildRequest; + + /** + * Creates a plain object from a CancelBuildRequest message. Also converts values to other types if specified. + * @param message CancelBuildRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.CancelBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelBuildRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelBuildRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApproveBuildRequest. */ + interface IApproveBuildRequest { + + /** ApproveBuildRequest name */ + name?: (string|null); + + /** ApproveBuildRequest approvalResult */ + approvalResult?: (google.devtools.cloudbuild.v1.IApprovalResult|null); + } + + /** Represents an ApproveBuildRequest. */ + class ApproveBuildRequest implements IApproveBuildRequest { + + /** + * Constructs a new ApproveBuildRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IApproveBuildRequest); + + /** ApproveBuildRequest name. */ + public name: string; + + /** ApproveBuildRequest approvalResult. */ + public approvalResult?: (google.devtools.cloudbuild.v1.IApprovalResult|null); + + /** + * Creates a new ApproveBuildRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApproveBuildRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IApproveBuildRequest): google.devtools.cloudbuild.v1.ApproveBuildRequest; + + /** + * Encodes the specified ApproveBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ApproveBuildRequest.verify|verify} messages. + * @param message ApproveBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IApproveBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApproveBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ApproveBuildRequest.verify|verify} messages. + * @param message ApproveBuildRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IApproveBuildRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApproveBuildRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApproveBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ApproveBuildRequest; + + /** + * Decodes an ApproveBuildRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApproveBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ApproveBuildRequest; + + /** + * Verifies an ApproveBuildRequest message. + * @param message Plain 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 ApproveBuildRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApproveBuildRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ApproveBuildRequest; + + /** + * Creates a plain object from an ApproveBuildRequest message. Also converts values to other types if specified. + * @param message ApproveBuildRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ApproveBuildRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApproveBuildRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApproveBuildRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildApproval. */ + interface IBuildApproval { + + /** BuildApproval state */ + state?: (google.devtools.cloudbuild.v1.BuildApproval.State|keyof typeof google.devtools.cloudbuild.v1.BuildApproval.State|null); + + /** BuildApproval config */ + config?: (google.devtools.cloudbuild.v1.IApprovalConfig|null); + + /** BuildApproval result */ + result?: (google.devtools.cloudbuild.v1.IApprovalResult|null); + } + + /** Represents a BuildApproval. */ + class BuildApproval implements IBuildApproval { + + /** + * Constructs a new BuildApproval. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuildApproval); + + /** BuildApproval state. */ + public state: (google.devtools.cloudbuild.v1.BuildApproval.State|keyof typeof google.devtools.cloudbuild.v1.BuildApproval.State); + + /** BuildApproval config. */ + public config?: (google.devtools.cloudbuild.v1.IApprovalConfig|null); + + /** BuildApproval result. */ + public result?: (google.devtools.cloudbuild.v1.IApprovalResult|null); + + /** + * Creates a new BuildApproval instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildApproval instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuildApproval): google.devtools.cloudbuild.v1.BuildApproval; + + /** + * Encodes the specified BuildApproval message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildApproval.verify|verify} messages. + * @param message BuildApproval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuildApproval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildApproval message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildApproval.verify|verify} messages. + * @param message BuildApproval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuildApproval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildApproval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildApproval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildApproval; + + /** + * Decodes a BuildApproval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildApproval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildApproval; + + /** + * Verifies a BuildApproval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildApproval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildApproval + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildApproval; + + /** + * Creates a plain object from a BuildApproval message. Also converts values to other types if specified. + * @param message BuildApproval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildApproval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildApproval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildApproval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BuildApproval { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + APPROVED = 2, + REJECTED = 3, + CANCELLED = 5 + } + } + + /** Properties of an ApprovalConfig. */ + interface IApprovalConfig { + + /** ApprovalConfig approvalRequired */ + approvalRequired?: (boolean|null); + } + + /** Represents an ApprovalConfig. */ + class ApprovalConfig implements IApprovalConfig { + + /** + * Constructs a new ApprovalConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IApprovalConfig); + + /** ApprovalConfig approvalRequired. */ + public approvalRequired: boolean; + + /** + * Creates a new ApprovalConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApprovalConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IApprovalConfig): google.devtools.cloudbuild.v1.ApprovalConfig; + + /** + * Encodes the specified ApprovalConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalConfig.verify|verify} messages. + * @param message ApprovalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IApprovalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApprovalConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalConfig.verify|verify} messages. + * @param message ApprovalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IApprovalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApprovalConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApprovalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ApprovalConfig; + + /** + * Decodes an ApprovalConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApprovalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ApprovalConfig; + + /** + * Verifies an ApprovalConfig message. + * @param message Plain 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 ApprovalConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApprovalConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ApprovalConfig; + + /** + * Creates a plain object from an ApprovalConfig message. Also converts values to other types if specified. + * @param message ApprovalConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ApprovalConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApprovalConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApprovalConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApprovalResult. */ + interface IApprovalResult { + + /** ApprovalResult approverAccount */ + approverAccount?: (string|null); + + /** ApprovalResult approvalTime */ + approvalTime?: (google.protobuf.ITimestamp|null); + + /** ApprovalResult decision */ + decision?: (google.devtools.cloudbuild.v1.ApprovalResult.Decision|keyof typeof google.devtools.cloudbuild.v1.ApprovalResult.Decision|null); + + /** ApprovalResult comment */ + comment?: (string|null); + + /** ApprovalResult url */ + url?: (string|null); + } + + /** Represents an ApprovalResult. */ + class ApprovalResult implements IApprovalResult { + + /** + * Constructs a new ApprovalResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IApprovalResult); + + /** ApprovalResult approverAccount. */ + public approverAccount: string; + + /** ApprovalResult approvalTime. */ + public approvalTime?: (google.protobuf.ITimestamp|null); + + /** ApprovalResult decision. */ + public decision: (google.devtools.cloudbuild.v1.ApprovalResult.Decision|keyof typeof google.devtools.cloudbuild.v1.ApprovalResult.Decision); + + /** ApprovalResult comment. */ + public comment: string; + + /** ApprovalResult url. */ + public url: string; + + /** + * Creates a new ApprovalResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ApprovalResult instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IApprovalResult): google.devtools.cloudbuild.v1.ApprovalResult; + + /** + * Encodes the specified ApprovalResult message. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalResult.verify|verify} messages. + * @param message ApprovalResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IApprovalResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApprovalResult message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalResult.verify|verify} messages. + * @param message ApprovalResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IApprovalResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApprovalResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApprovalResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ApprovalResult; + + /** + * Decodes an ApprovalResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApprovalResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ApprovalResult; + + /** + * Verifies an ApprovalResult message. + * @param message Plain 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 ApprovalResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApprovalResult + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ApprovalResult; + + /** + * Creates a plain object from an ApprovalResult message. Also converts values to other types if specified. + * @param message ApprovalResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ApprovalResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApprovalResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApprovalResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApprovalResult { + + /** Decision enum. */ + enum Decision { + DECISION_UNSPECIFIED = 0, + APPROVED = 1, + REJECTED = 2 + } + } + + /** Properties of a BuildTrigger. */ + interface IBuildTrigger { + + /** BuildTrigger resourceName */ + resourceName?: (string|null); + + /** BuildTrigger id */ + id?: (string|null); + + /** BuildTrigger description */ + description?: (string|null); + + /** BuildTrigger name */ + name?: (string|null); + + /** BuildTrigger tags */ + tags?: (string[]|null); + + /** BuildTrigger triggerTemplate */ + triggerTemplate?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** BuildTrigger github */ + github?: (google.devtools.cloudbuild.v1.IGitHubEventsConfig|null); + + /** BuildTrigger pubsubConfig */ + pubsubConfig?: (google.devtools.cloudbuild.v1.IPubsubConfig|null); + + /** BuildTrigger webhookConfig */ + webhookConfig?: (google.devtools.cloudbuild.v1.IWebhookConfig|null); + + /** BuildTrigger autodetect */ + autodetect?: (boolean|null); + + /** BuildTrigger build */ + build?: (google.devtools.cloudbuild.v1.IBuild|null); + + /** BuildTrigger filename */ + filename?: (string|null); + + /** BuildTrigger createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BuildTrigger disabled */ + disabled?: (boolean|null); + + /** BuildTrigger substitutions */ + substitutions?: ({ [k: string]: string }|null); + + /** BuildTrigger ignoredFiles */ + ignoredFiles?: (string[]|null); + + /** BuildTrigger includedFiles */ + includedFiles?: (string[]|null); + + /** BuildTrigger filter */ + filter?: (string|null); + + /** BuildTrigger serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents a BuildTrigger. */ + class BuildTrigger implements IBuildTrigger { + + /** + * Constructs a new BuildTrigger. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuildTrigger); + + /** BuildTrigger resourceName. */ + public resourceName: string; + + /** BuildTrigger id. */ + public id: string; + + /** BuildTrigger description. */ + public description: string; + + /** BuildTrigger name. */ + public name: string; + + /** BuildTrigger tags. */ + public tags: string[]; + + /** BuildTrigger triggerTemplate. */ + public triggerTemplate?: (google.devtools.cloudbuild.v1.IRepoSource|null); + + /** BuildTrigger github. */ + public github?: (google.devtools.cloudbuild.v1.IGitHubEventsConfig|null); + + /** BuildTrigger pubsubConfig. */ + public pubsubConfig?: (google.devtools.cloudbuild.v1.IPubsubConfig|null); + + /** BuildTrigger webhookConfig. */ + public webhookConfig?: (google.devtools.cloudbuild.v1.IWebhookConfig|null); + + /** BuildTrigger autodetect. */ + public autodetect?: (boolean|null); + + /** BuildTrigger build. */ + public build?: (google.devtools.cloudbuild.v1.IBuild|null); + + /** BuildTrigger filename. */ + public filename?: (string|null); + + /** BuildTrigger createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BuildTrigger disabled. */ + public disabled: boolean; + + /** BuildTrigger substitutions. */ + public substitutions: { [k: string]: string }; + + /** BuildTrigger ignoredFiles. */ + public ignoredFiles: string[]; + + /** BuildTrigger includedFiles. */ + public includedFiles: string[]; + + /** BuildTrigger filter. */ + public filter: string; + + /** BuildTrigger serviceAccount. */ + public serviceAccount: string; + + /** BuildTrigger buildTemplate. */ + public buildTemplate?: ("autodetect"|"build"|"filename"); + + /** + * Creates a new BuildTrigger instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildTrigger instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuildTrigger): google.devtools.cloudbuild.v1.BuildTrigger; + + /** + * Encodes the specified BuildTrigger message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * @param message BuildTrigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuildTrigger, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildTrigger message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * @param message BuildTrigger message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuildTrigger, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildTrigger message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildTrigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildTrigger; + + /** + * Decodes a BuildTrigger message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildTrigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildTrigger; + + /** + * Verifies a BuildTrigger message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildTrigger message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildTrigger + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildTrigger; + + /** + * Creates a plain object from a BuildTrigger message. Also converts values to other types if specified. + * @param message BuildTrigger + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildTrigger, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildTrigger to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildTrigger + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GitHubEventsConfig. */ + interface IGitHubEventsConfig { + + /** GitHubEventsConfig installationId */ + installationId?: (number|Long|string|null); + + /** GitHubEventsConfig owner */ + owner?: (string|null); + + /** GitHubEventsConfig name */ + name?: (string|null); + + /** GitHubEventsConfig pullRequest */ + pullRequest?: (google.devtools.cloudbuild.v1.IPullRequestFilter|null); + + /** GitHubEventsConfig push */ + push?: (google.devtools.cloudbuild.v1.IPushFilter|null); + } + + /** Represents a GitHubEventsConfig. */ + class GitHubEventsConfig implements IGitHubEventsConfig { + + /** + * Constructs a new GitHubEventsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IGitHubEventsConfig); + + /** GitHubEventsConfig installationId. */ + public installationId: (number|Long|string); + + /** GitHubEventsConfig owner. */ + public owner: string; + + /** GitHubEventsConfig name. */ + public name: string; + + /** GitHubEventsConfig pullRequest. */ + public pullRequest?: (google.devtools.cloudbuild.v1.IPullRequestFilter|null); + + /** GitHubEventsConfig push. */ + public push?: (google.devtools.cloudbuild.v1.IPushFilter|null); + + /** GitHubEventsConfig event. */ + public event?: ("pullRequest"|"push"); + + /** + * Creates a new GitHubEventsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GitHubEventsConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IGitHubEventsConfig): google.devtools.cloudbuild.v1.GitHubEventsConfig; + + /** + * Encodes the specified GitHubEventsConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * @param message GitHubEventsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IGitHubEventsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitHubEventsConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * @param message GitHubEventsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IGitHubEventsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitHubEventsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitHubEventsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.GitHubEventsConfig; + + /** + * Decodes a GitHubEventsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitHubEventsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.GitHubEventsConfig; + + /** + * Verifies a GitHubEventsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GitHubEventsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitHubEventsConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.GitHubEventsConfig; + + /** + * Creates a plain object from a GitHubEventsConfig message. Also converts values to other types if specified. + * @param message GitHubEventsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.GitHubEventsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitHubEventsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GitHubEventsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PubsubConfig. */ + interface IPubsubConfig { + + /** PubsubConfig subscription */ + subscription?: (string|null); + + /** PubsubConfig topic */ + topic?: (string|null); + + /** PubsubConfig serviceAccountEmail */ + serviceAccountEmail?: (string|null); + + /** PubsubConfig state */ + state?: (google.devtools.cloudbuild.v1.PubsubConfig.State|keyof typeof google.devtools.cloudbuild.v1.PubsubConfig.State|null); + } + + /** Represents a PubsubConfig. */ + class PubsubConfig implements IPubsubConfig { + + /** + * Constructs a new PubsubConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IPubsubConfig); + + /** PubsubConfig subscription. */ + public subscription: string; + + /** PubsubConfig topic. */ + public topic: string; + + /** PubsubConfig serviceAccountEmail. */ + public serviceAccountEmail: string; + + /** PubsubConfig state. */ + public state: (google.devtools.cloudbuild.v1.PubsubConfig.State|keyof typeof google.devtools.cloudbuild.v1.PubsubConfig.State); + + /** + * Creates a new PubsubConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IPubsubConfig): google.devtools.cloudbuild.v1.PubsubConfig; + + /** + * Encodes the specified PubsubConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PubsubConfig.verify|verify} messages. + * @param message PubsubConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IPubsubConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PubsubConfig.verify|verify} messages. + * @param message PubsubConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IPubsubConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PubsubConfig; + + /** + * Decodes a PubsubConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PubsubConfig; + + /** + * Verifies a PubsubConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PubsubConfig; + + /** + * Creates a plain object from a PubsubConfig message. Also converts values to other types if specified. + * @param message PubsubConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PubsubConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PubsubConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + OK = 1, + SUBSCRIPTION_DELETED = 2, + TOPIC_DELETED = 3, + SUBSCRIPTION_MISCONFIGURED = 4 + } + } + + /** Properties of a WebhookConfig. */ + interface IWebhookConfig { + + /** WebhookConfig secret */ + secret?: (string|null); + + /** WebhookConfig state */ + state?: (google.devtools.cloudbuild.v1.WebhookConfig.State|keyof typeof google.devtools.cloudbuild.v1.WebhookConfig.State|null); + } + + /** Represents a WebhookConfig. */ + class WebhookConfig implements IWebhookConfig { + + /** + * Constructs a new WebhookConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IWebhookConfig); + + /** WebhookConfig secret. */ + public secret?: (string|null); + + /** WebhookConfig state. */ + public state: (google.devtools.cloudbuild.v1.WebhookConfig.State|keyof typeof google.devtools.cloudbuild.v1.WebhookConfig.State); + + /** WebhookConfig authMethod. */ + public authMethod?: "secret"; + + /** + * Creates a new WebhookConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IWebhookConfig): google.devtools.cloudbuild.v1.WebhookConfig; + + /** + * Encodes the specified WebhookConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.WebhookConfig.verify|verify} messages. + * @param message WebhookConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IWebhookConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.WebhookConfig.verify|verify} messages. + * @param message WebhookConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IWebhookConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.WebhookConfig; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.WebhookConfig; + + /** + * Verifies a WebhookConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebhookConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.WebhookConfig; + + /** + * Creates a plain object from a WebhookConfig message. Also converts values to other types if specified. + * @param message WebhookConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.WebhookConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WebhookConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WebhookConfig { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + OK = 1, + SECRET_DELETED = 2 + } + } + + /** Properties of a PullRequestFilter. */ + interface IPullRequestFilter { + + /** PullRequestFilter branch */ + branch?: (string|null); + + /** PullRequestFilter commentControl */ + commentControl?: (google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|keyof typeof google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|null); + + /** PullRequestFilter invertRegex */ + invertRegex?: (boolean|null); + } + + /** Represents a PullRequestFilter. */ + class PullRequestFilter implements IPullRequestFilter { + + /** + * Constructs a new PullRequestFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IPullRequestFilter); + + /** PullRequestFilter branch. */ + public branch?: (string|null); + + /** PullRequestFilter commentControl. */ + public commentControl: (google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|keyof typeof google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl); + + /** PullRequestFilter invertRegex. */ + public invertRegex: boolean; + + /** PullRequestFilter gitRef. */ + public gitRef?: "branch"; + + /** + * Creates a new PullRequestFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns PullRequestFilter instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IPullRequestFilter): google.devtools.cloudbuild.v1.PullRequestFilter; + + /** + * Encodes the specified PullRequestFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. + * @param message PullRequestFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IPullRequestFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PullRequestFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. + * @param message PullRequestFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IPullRequestFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PullRequestFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PullRequestFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PullRequestFilter; + + /** + * Decodes a PullRequestFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PullRequestFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PullRequestFilter; + + /** + * Verifies a PullRequestFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PullRequestFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PullRequestFilter + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PullRequestFilter; + + /** + * Creates a plain object from a PullRequestFilter message. Also converts values to other types if specified. + * @param message PullRequestFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PullRequestFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PullRequestFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PullRequestFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PullRequestFilter { + + /** CommentControl enum. */ + enum CommentControl { + COMMENTS_DISABLED = 0, + COMMENTS_ENABLED = 1, + COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2 + } + } + + /** Properties of a PushFilter. */ + interface IPushFilter { + + /** PushFilter branch */ + branch?: (string|null); + + /** PushFilter tag */ + tag?: (string|null); + + /** PushFilter invertRegex */ + invertRegex?: (boolean|null); + } + + /** Represents a PushFilter. */ + class PushFilter implements IPushFilter { + + /** + * Constructs a new PushFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IPushFilter); + + /** PushFilter branch. */ + public branch?: (string|null); + + /** PushFilter tag. */ + public tag?: (string|null); + + /** PushFilter invertRegex. */ + public invertRegex: boolean; + + /** PushFilter gitRef. */ + public gitRef?: ("branch"|"tag"); + + /** + * Creates a new PushFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns PushFilter instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IPushFilter): google.devtools.cloudbuild.v1.PushFilter; + + /** + * Encodes the specified PushFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. + * @param message PushFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IPushFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PushFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. + * @param message PushFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IPushFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PushFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PushFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PushFilter; + + /** + * Decodes a PushFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PushFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PushFilter; + + /** + * Verifies a PushFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PushFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PushFilter + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PushFilter; + + /** + * Creates a plain object from a PushFilter message. Also converts values to other types if specified. + * @param message PushFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PushFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PushFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PushFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBuildTriggerRequest. */ + interface ICreateBuildTriggerRequest { + + /** CreateBuildTriggerRequest parent */ + parent?: (string|null); + + /** CreateBuildTriggerRequest projectId */ + projectId?: (string|null); + + /** CreateBuildTriggerRequest trigger */ + trigger?: (google.devtools.cloudbuild.v1.IBuildTrigger|null); + } + + /** Represents a CreateBuildTriggerRequest. */ + class CreateBuildTriggerRequest implements ICreateBuildTriggerRequest { + + /** + * Constructs a new CreateBuildTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest); + + /** CreateBuildTriggerRequest parent. */ + public parent: string; + + /** CreateBuildTriggerRequest projectId. */ + public projectId: string; + + /** CreateBuildTriggerRequest trigger. */ + public trigger?: (google.devtools.cloudbuild.v1.IBuildTrigger|null); + + /** + * Creates a new CreateBuildTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBuildTriggerRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest): google.devtools.cloudbuild.v1.CreateBuildTriggerRequest; + + /** + * Encodes the specified CreateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. + * @param message CreateBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. + * @param message CreateBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.CreateBuildTriggerRequest; + + /** + * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.CreateBuildTriggerRequest; + + /** + * Verifies a CreateBuildTriggerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBuildTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.CreateBuildTriggerRequest; + + /** + * Creates a plain object from a CreateBuildTriggerRequest message. Also converts values to other types if specified. + * @param message CreateBuildTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.CreateBuildTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBuildTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBuildTriggerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBuildTriggerRequest. */ + interface IGetBuildTriggerRequest { + + /** GetBuildTriggerRequest name */ + name?: (string|null); + + /** GetBuildTriggerRequest projectId */ + projectId?: (string|null); + + /** GetBuildTriggerRequest triggerId */ + triggerId?: (string|null); + } + + /** Represents a GetBuildTriggerRequest. */ + class GetBuildTriggerRequest implements IGetBuildTriggerRequest { + + /** + * Constructs a new GetBuildTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IGetBuildTriggerRequest); + + /** GetBuildTriggerRequest name. */ + public name: string; + + /** GetBuildTriggerRequest projectId. */ + public projectId: string; + + /** GetBuildTriggerRequest triggerId. */ + public triggerId: string; + + /** + * Creates a new GetBuildTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBuildTriggerRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IGetBuildTriggerRequest): google.devtools.cloudbuild.v1.GetBuildTriggerRequest; + + /** + * Encodes the specified GetBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. + * @param message GetBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. + * @param message GetBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBuildTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.GetBuildTriggerRequest; + + /** + * Decodes a GetBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.GetBuildTriggerRequest; + + /** + * Verifies a GetBuildTriggerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBuildTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.GetBuildTriggerRequest; + + /** + * Creates a plain object from a GetBuildTriggerRequest message. Also converts values to other types if specified. + * @param message GetBuildTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.GetBuildTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBuildTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBuildTriggerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBuildTriggersRequest. */ + interface IListBuildTriggersRequest { + + /** ListBuildTriggersRequest parent */ + parent?: (string|null); + + /** ListBuildTriggersRequest projectId */ + projectId?: (string|null); + + /** ListBuildTriggersRequest pageSize */ + pageSize?: (number|null); + + /** ListBuildTriggersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBuildTriggersRequest. */ + class ListBuildTriggersRequest implements IListBuildTriggersRequest { + + /** + * Constructs a new ListBuildTriggersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IListBuildTriggersRequest); + + /** ListBuildTriggersRequest parent. */ + public parent: string; + + /** ListBuildTriggersRequest projectId. */ + public projectId: string; + + /** ListBuildTriggersRequest pageSize. */ + public pageSize: number; + + /** ListBuildTriggersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBuildTriggersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBuildTriggersRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IListBuildTriggersRequest): google.devtools.cloudbuild.v1.ListBuildTriggersRequest; + + /** + * Encodes the specified ListBuildTriggersRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. + * @param message ListBuildTriggersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IListBuildTriggersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBuildTriggersRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. + * @param message ListBuildTriggersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IListBuildTriggersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBuildTriggersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBuildTriggersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ListBuildTriggersRequest; + + /** + * Decodes a ListBuildTriggersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBuildTriggersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ListBuildTriggersRequest; + + /** + * Verifies a ListBuildTriggersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBuildTriggersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBuildTriggersRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ListBuildTriggersRequest; + + /** + * Creates a plain object from a ListBuildTriggersRequest message. Also converts values to other types if specified. + * @param message ListBuildTriggersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ListBuildTriggersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBuildTriggersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBuildTriggersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBuildTriggersResponse. */ + interface IListBuildTriggersResponse { + + /** ListBuildTriggersResponse triggers */ + triggers?: (google.devtools.cloudbuild.v1.IBuildTrigger[]|null); + + /** ListBuildTriggersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListBuildTriggersResponse. */ + class ListBuildTriggersResponse implements IListBuildTriggersResponse { + + /** + * Constructs a new ListBuildTriggersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IListBuildTriggersResponse); + + /** ListBuildTriggersResponse triggers. */ + public triggers: google.devtools.cloudbuild.v1.IBuildTrigger[]; + + /** ListBuildTriggersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListBuildTriggersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBuildTriggersResponse instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IListBuildTriggersResponse): google.devtools.cloudbuild.v1.ListBuildTriggersResponse; + + /** + * Encodes the specified ListBuildTriggersResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * @param message ListBuildTriggersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IListBuildTriggersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBuildTriggersResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * @param message ListBuildTriggersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IListBuildTriggersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBuildTriggersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBuildTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ListBuildTriggersResponse; + + /** + * Decodes a ListBuildTriggersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBuildTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ListBuildTriggersResponse; + + /** + * Verifies a ListBuildTriggersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBuildTriggersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBuildTriggersResponse + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ListBuildTriggersResponse; + + /** + * Creates a plain object from a ListBuildTriggersResponse message. Also converts values to other types if specified. + * @param message ListBuildTriggersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ListBuildTriggersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBuildTriggersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBuildTriggersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBuildTriggerRequest. */ + interface IDeleteBuildTriggerRequest { + + /** DeleteBuildTriggerRequest name */ + name?: (string|null); + + /** DeleteBuildTriggerRequest projectId */ + projectId?: (string|null); + + /** DeleteBuildTriggerRequest triggerId */ + triggerId?: (string|null); + } + + /** Represents a DeleteBuildTriggerRequest. */ + class DeleteBuildTriggerRequest implements IDeleteBuildTriggerRequest { + + /** + * Constructs a new DeleteBuildTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest); + + /** DeleteBuildTriggerRequest name. */ + public name: string; + + /** DeleteBuildTriggerRequest projectId. */ + public projectId: string; + + /** DeleteBuildTriggerRequest triggerId. */ + public triggerId: string; + + /** + * Creates a new DeleteBuildTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBuildTriggerRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest): google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest; + + /** + * Encodes the specified DeleteBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. + * @param message DeleteBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. + * @param message DeleteBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest; + + /** + * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest; + + /** + * Verifies a DeleteBuildTriggerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBuildTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest; + + /** + * Creates a plain object from a DeleteBuildTriggerRequest message. Also converts values to other types if specified. + * @param message DeleteBuildTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBuildTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBuildTriggerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBuildTriggerRequest. */ + interface IUpdateBuildTriggerRequest { + + /** UpdateBuildTriggerRequest projectId */ + projectId?: (string|null); + + /** UpdateBuildTriggerRequest triggerId */ + triggerId?: (string|null); + + /** UpdateBuildTriggerRequest trigger */ + trigger?: (google.devtools.cloudbuild.v1.IBuildTrigger|null); + } + + /** Represents an UpdateBuildTriggerRequest. */ + class UpdateBuildTriggerRequest implements IUpdateBuildTriggerRequest { + + /** + * Constructs a new UpdateBuildTriggerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest); + + /** UpdateBuildTriggerRequest projectId. */ + public projectId: string; + + /** UpdateBuildTriggerRequest triggerId. */ + public triggerId: string; + + /** UpdateBuildTriggerRequest trigger. */ + public trigger?: (google.devtools.cloudbuild.v1.IBuildTrigger|null); + + /** + * Creates a new UpdateBuildTriggerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBuildTriggerRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest): google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest; + + /** + * Encodes the specified UpdateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * @param message UpdateBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * @param message UpdateBuildTriggerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest; + + /** + * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest; + + /** + * Verifies an UpdateBuildTriggerRequest message. + * @param message Plain 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 UpdateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBuildTriggerRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest; + + /** + * Creates a plain object from an UpdateBuildTriggerRequest message. Also converts values to other types if specified. + * @param message UpdateBuildTriggerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBuildTriggerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBuildTriggerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BuildOptions. */ + interface IBuildOptions { + + /** BuildOptions sourceProvenanceHash */ + sourceProvenanceHash?: (google.devtools.cloudbuild.v1.Hash.HashType[]|null); + + /** BuildOptions requestedVerifyOption */ + requestedVerifyOption?: (google.devtools.cloudbuild.v1.BuildOptions.VerifyOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.VerifyOption|null); + + /** BuildOptions machineType */ + machineType?: (google.devtools.cloudbuild.v1.BuildOptions.MachineType|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.MachineType|null); + + /** BuildOptions diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** BuildOptions substitutionOption */ + substitutionOption?: (google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|null); + + /** BuildOptions dynamicSubstitutions */ + dynamicSubstitutions?: (boolean|null); + + /** BuildOptions logStreamingOption */ + logStreamingOption?: (google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|null); + + /** BuildOptions workerPool */ + workerPool?: (string|null); + + /** BuildOptions pool */ + pool?: (google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null); + + /** BuildOptions logging */ + logging?: (google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|null); + + /** BuildOptions env */ + env?: (string[]|null); + + /** BuildOptions secretEnv */ + secretEnv?: (string[]|null); + + /** BuildOptions volumes */ + volumes?: (google.devtools.cloudbuild.v1.IVolume[]|null); + } + + /** Represents a BuildOptions. */ + class BuildOptions implements IBuildOptions { + + /** + * Constructs a new BuildOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IBuildOptions); + + /** BuildOptions sourceProvenanceHash. */ + public sourceProvenanceHash: google.devtools.cloudbuild.v1.Hash.HashType[]; + + /** BuildOptions requestedVerifyOption. */ + public requestedVerifyOption: (google.devtools.cloudbuild.v1.BuildOptions.VerifyOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.VerifyOption); + + /** BuildOptions machineType. */ + public machineType: (google.devtools.cloudbuild.v1.BuildOptions.MachineType|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.MachineType); + + /** BuildOptions diskSizeGb. */ + public diskSizeGb: (number|Long|string); + + /** BuildOptions substitutionOption. */ + public substitutionOption: (google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption); + + /** BuildOptions dynamicSubstitutions. */ + public dynamicSubstitutions: boolean; + + /** BuildOptions logStreamingOption. */ + public logStreamingOption: (google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption); + + /** BuildOptions workerPool. */ + public workerPool: string; + + /** BuildOptions pool. */ + public pool?: (google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null); + + /** BuildOptions logging. */ + public logging: (google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LoggingMode); + + /** BuildOptions env. */ + public env: string[]; + + /** BuildOptions secretEnv. */ + public secretEnv: string[]; + + /** BuildOptions volumes. */ + public volumes: google.devtools.cloudbuild.v1.IVolume[]; + + /** + * Creates a new BuildOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildOptions instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IBuildOptions): google.devtools.cloudbuild.v1.BuildOptions; + + /** + * Encodes the specified BuildOptions message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * @param message BuildOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IBuildOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildOptions message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * @param message BuildOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IBuildOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildOptions; + + /** + * Decodes a BuildOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildOptions; + + /** + * Verifies a BuildOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildOptions + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildOptions; + + /** + * Creates a plain object from a BuildOptions message. Also converts values to other types if specified. + * @param message BuildOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BuildOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BuildOptions { + + /** Properties of a PoolOption. */ + interface IPoolOption { + + /** PoolOption name */ + name?: (string|null); + } + + /** Represents a PoolOption. */ + class PoolOption implements IPoolOption { + + /** + * Constructs a new PoolOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption); + + /** PoolOption name. */ + public name: string; + + /** + * Creates a new PoolOption instance using the specified properties. + * @param [properties] Properties to set + * @returns PoolOption instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Encodes the specified PoolOption message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @param message PoolOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PoolOption message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @param message PoolOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PoolOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Decodes a PoolOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Verifies a PoolOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PoolOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PoolOption + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Creates a plain object from a PoolOption message. Also converts values to other types if specified. + * @param message PoolOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildOptions.PoolOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PoolOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PoolOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerifyOption enum. */ + enum VerifyOption { + NOT_VERIFIED = 0, + VERIFIED = 1 + } + + /** MachineType enum. */ + enum MachineType { + UNSPECIFIED = 0, + N1_HIGHCPU_8 = 1, + N1_HIGHCPU_32 = 2, + E2_HIGHCPU_8 = 5, + E2_HIGHCPU_32 = 6 + } + + /** SubstitutionOption enum. */ + enum SubstitutionOption { + MUST_MATCH = 0, + ALLOW_LOOSE = 1 + } + + /** LogStreamingOption enum. */ + enum LogStreamingOption { + STREAM_DEFAULT = 0, + STREAM_ON = 1, + STREAM_OFF = 2 + } + + /** LoggingMode enum. */ + enum LoggingMode { + LOGGING_UNSPECIFIED = 0, + LEGACY = 1, + GCS_ONLY = 2, + STACKDRIVER_ONLY = 3, + CLOUD_LOGGING_ONLY = 5, + NONE = 4 + } + } + + /** Properties of a ReceiveTriggerWebhookRequest. */ + interface IReceiveTriggerWebhookRequest { + + /** ReceiveTriggerWebhookRequest name */ + name?: (string|null); + + /** ReceiveTriggerWebhookRequest body */ + body?: (google.api.IHttpBody|null); + + /** ReceiveTriggerWebhookRequest projectId */ + projectId?: (string|null); + + /** ReceiveTriggerWebhookRequest trigger */ + trigger?: (string|null); + + /** ReceiveTriggerWebhookRequest secret */ + secret?: (string|null); + } + + /** Represents a ReceiveTriggerWebhookRequest. */ + class ReceiveTriggerWebhookRequest implements IReceiveTriggerWebhookRequest { + + /** + * Constructs a new ReceiveTriggerWebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest); + + /** ReceiveTriggerWebhookRequest name. */ + public name: string; + + /** ReceiveTriggerWebhookRequest body. */ + public body?: (google.api.IHttpBody|null); + + /** ReceiveTriggerWebhookRequest projectId. */ + public projectId: string; + + /** ReceiveTriggerWebhookRequest trigger. */ + public trigger: string; + + /** ReceiveTriggerWebhookRequest secret. */ + public secret: string; + + /** + * Creates a new ReceiveTriggerWebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveTriggerWebhookRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @param message ReceiveTriggerWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @param message ReceiveTriggerWebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Verifies a ReceiveTriggerWebhookRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveTriggerWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveTriggerWebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest; + + /** + * Creates a plain object from a ReceiveTriggerWebhookRequest message. Also converts values to other types if specified. + * @param message ReceiveTriggerWebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveTriggerWebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceiveTriggerWebhookRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReceiveTriggerWebhookResponse. */ + interface IReceiveTriggerWebhookResponse { + } + + /** Represents a ReceiveTriggerWebhookResponse. */ + class ReceiveTriggerWebhookResponse implements IReceiveTriggerWebhookResponse { + + /** + * Constructs a new ReceiveTriggerWebhookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse); + + /** + * Creates a new ReceiveTriggerWebhookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReceiveTriggerWebhookResponse instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @param message ReceiveTriggerWebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @param message ReceiveTriggerWebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Verifies a ReceiveTriggerWebhookResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReceiveTriggerWebhookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReceiveTriggerWebhookResponse + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse; + + /** + * Creates a plain object from a ReceiveTriggerWebhookResponse message. Also converts values to other types if specified. + * @param message ReceiveTriggerWebhookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReceiveTriggerWebhookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReceiveTriggerWebhookResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkerPool. */ + interface IWorkerPool { + + /** WorkerPool name */ + name?: (string|null); + + /** WorkerPool displayName */ + displayName?: (string|null); + + /** WorkerPool uid */ + uid?: (string|null); + + /** WorkerPool annotations */ + annotations?: ({ [k: string]: string }|null); + + /** WorkerPool createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool state */ + state?: (google.devtools.cloudbuild.v1.WorkerPool.State|keyof typeof google.devtools.cloudbuild.v1.WorkerPool.State|null); + + /** WorkerPool privatePoolV1Config */ + privatePoolV1Config?: (google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null); + + /** WorkerPool etag */ + etag?: (string|null); + } + + /** Represents a WorkerPool. */ + class WorkerPool implements IWorkerPool { + + /** + * Constructs a new WorkerPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IWorkerPool); + + /** WorkerPool name. */ + public name: string; + + /** WorkerPool displayName. */ + public displayName: string; + + /** WorkerPool uid. */ + public uid: string; + + /** WorkerPool annotations. */ + public annotations: { [k: string]: string }; + + /** WorkerPool createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkerPool state. */ + public state: (google.devtools.cloudbuild.v1.WorkerPool.State|keyof typeof google.devtools.cloudbuild.v1.WorkerPool.State); + + /** WorkerPool privatePoolV1Config. */ + public privatePoolV1Config?: (google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null); + + /** WorkerPool etag. */ + public etag: string; + + /** WorkerPool config. */ + public config?: "privatePoolV1Config"; + + /** + * Creates a new WorkerPool instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerPool instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IWorkerPool): google.devtools.cloudbuild.v1.WorkerPool; + + /** + * Encodes the specified WorkerPool message. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerPool.verify|verify} messages. + * @param message WorkerPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerPool.verify|verify} messages. + * @param message WorkerPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IWorkerPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.WorkerPool; + + /** + * Decodes a WorkerPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.WorkerPool; + + /** + * Verifies a WorkerPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerPool + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.WorkerPool; + + /** + * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. + * @param message WorkerPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.WorkerPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkerPool { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + RUNNING = 2, + DELETING = 3, + DELETED = 4 + } + } + + /** Properties of a PrivatePoolV1Config. */ + interface IPrivatePoolV1Config { + + /** PrivatePoolV1Config workerConfig */ + workerConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null); + + /** PrivatePoolV1Config networkConfig */ + networkConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null); + } + + /** Represents a PrivatePoolV1Config. */ + class PrivatePoolV1Config implements IPrivatePoolV1Config { + + /** + * Constructs a new PrivatePoolV1Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IPrivatePoolV1Config); + + /** PrivatePoolV1Config workerConfig. */ + public workerConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null); + + /** PrivatePoolV1Config networkConfig. */ + public networkConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null); + + /** + * Creates a new PrivatePoolV1Config instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivatePoolV1Config instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IPrivatePoolV1Config): google.devtools.cloudbuild.v1.PrivatePoolV1Config; + + /** + * Encodes the specified PrivatePoolV1Config message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. + * @param message PrivatePoolV1Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IPrivatePoolV1Config, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivatePoolV1Config message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. + * @param message PrivatePoolV1Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IPrivatePoolV1Config, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivatePoolV1Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivatePoolV1Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PrivatePoolV1Config; + + /** + * Decodes a PrivatePoolV1Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivatePoolV1Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PrivatePoolV1Config; + + /** + * Verifies a PrivatePoolV1Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivatePoolV1Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivatePoolV1Config + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PrivatePoolV1Config; + + /** + * Creates a plain object from a PrivatePoolV1Config message. Also converts values to other types if specified. + * @param message PrivatePoolV1Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivatePoolV1Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivatePoolV1Config + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PrivatePoolV1Config { + + /** Properties of a WorkerConfig. */ + interface IWorkerConfig { + + /** WorkerConfig machineType */ + machineType?: (string|null); + + /** WorkerConfig diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + } + + /** Represents a WorkerConfig. */ + class WorkerConfig implements IWorkerConfig { + + /** + * Constructs a new WorkerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig); + + /** WorkerConfig machineType. */ + public machineType: string; + + /** WorkerConfig diskSizeGb. */ + public diskSizeGb: (number|Long|string); + + /** + * Creates a new WorkerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; + + /** + * Encodes the specified WorkerConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @param message WorkerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkerConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @param message WorkerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; + + /** + * Decodes a WorkerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; + + /** + * Verifies a WorkerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; + + /** + * Creates a plain object from a WorkerConfig message. Also converts values to other types if specified. + * @param message WorkerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig peeredNetwork */ + peeredNetwork?: (string|null); + + /** NetworkConfig egressOption */ + egressOption?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|keyof typeof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig); + + /** NetworkConfig peeredNetwork. */ + public peeredNetwork: string; + + /** NetworkConfig egressOption. */ + public egressOption: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|keyof typeof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption); + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkConfig { + + /** EgressOption enum. */ + enum EgressOption { + EGRESS_OPTION_UNSPECIFIED = 0, + NO_PUBLIC_EGRESS = 1, + PUBLIC_EGRESS = 2 + } + } + } + + /** Properties of a CreateWorkerPoolRequest. */ + interface ICreateWorkerPoolRequest { + + /** CreateWorkerPoolRequest parent */ + parent?: (string|null); + + /** CreateWorkerPoolRequest workerPool */ + workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + + /** CreateWorkerPoolRequest workerPoolId */ + workerPoolId?: (string|null); + + /** CreateWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateWorkerPoolRequest. */ + class CreateWorkerPoolRequest implements ICreateWorkerPoolRequest { + + /** + * Constructs a new CreateWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest); + + /** CreateWorkerPoolRequest parent. */ + public parent: string; + + /** CreateWorkerPoolRequest workerPool. */ + public workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + + /** CreateWorkerPoolRequest workerPoolId. */ + public workerPoolId: string; + + /** CreateWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkerPoolRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest): google.devtools.cloudbuild.v1.CreateWorkerPoolRequest; + + /** + * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * @param message CreateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * @param message CreateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.CreateWorkerPoolRequest; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.CreateWorkerPoolRequest; + + /** + * Verifies a CreateWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.CreateWorkerPoolRequest; + + /** + * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. + * @param message CreateWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.CreateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWorkerPoolRequest. */ + interface IGetWorkerPoolRequest { + + /** GetWorkerPoolRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkerPoolRequest. */ + class GetWorkerPoolRequest implements IGetWorkerPoolRequest { + + /** + * Constructs a new GetWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IGetWorkerPoolRequest); + + /** GetWorkerPoolRequest name. */ + public name: string; + + /** + * Creates a new GetWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkerPoolRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IGetWorkerPoolRequest): google.devtools.cloudbuild.v1.GetWorkerPoolRequest; + + /** + * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * @param message GetWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * @param message GetWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.GetWorkerPoolRequest; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.GetWorkerPoolRequest; + + /** + * Verifies a GetWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.GetWorkerPoolRequest; + + /** + * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. + * @param message GetWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.GetWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkerPoolRequest. */ + interface IDeleteWorkerPoolRequest { + + /** DeleteWorkerPoolRequest name */ + name?: (string|null); + + /** DeleteWorkerPoolRequest etag */ + etag?: (string|null); + + /** DeleteWorkerPoolRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a DeleteWorkerPoolRequest. */ + class DeleteWorkerPoolRequest implements IDeleteWorkerPoolRequest { + + /** + * Constructs a new DeleteWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest); + + /** DeleteWorkerPoolRequest name. */ + public name: string; + + /** DeleteWorkerPoolRequest etag. */ + public etag: string; + + /** DeleteWorkerPoolRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new DeleteWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkerPoolRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest): google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest; + + /** + * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * @param message DeleteWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * @param message DeleteWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest; + + /** + * Verifies a DeleteWorkerPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest; + + /** + * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. + * @param message DeleteWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkerPoolRequest. */ + interface IUpdateWorkerPoolRequest { + + /** UpdateWorkerPoolRequest workerPool */ + workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + + /** UpdateWorkerPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateWorkerPoolRequest. */ + class UpdateWorkerPoolRequest implements IUpdateWorkerPoolRequest { + + /** + * Constructs a new UpdateWorkerPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest); + + /** UpdateWorkerPoolRequest workerPool. */ + public workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + + /** UpdateWorkerPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateWorkerPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkerPoolRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest): google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest; + + /** + * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. + * @param message UpdateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. + * @param message UpdateWorkerPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest; + + /** + * Verifies an UpdateWorkerPoolRequest message. + * @param message Plain 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 UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkerPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest; + + /** + * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. + * @param message UpdateWorkerPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkerPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkerPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkerPoolsRequest. */ + interface IListWorkerPoolsRequest { + + /** ListWorkerPoolsRequest parent */ + parent?: (string|null); + + /** ListWorkerPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkerPoolsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWorkerPoolsRequest. */ + class ListWorkerPoolsRequest implements IListWorkerPoolsRequest { + + /** + * Constructs a new ListWorkerPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IListWorkerPoolsRequest); + + /** ListWorkerPoolsRequest parent. */ + public parent: string; + + /** ListWorkerPoolsRequest pageSize. */ + public pageSize: number; + + /** ListWorkerPoolsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWorkerPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkerPoolsRequest instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IListWorkerPoolsRequest): google.devtools.cloudbuild.v1.ListWorkerPoolsRequest; + + /** + * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. + * @param message ListWorkerPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. + * @param message ListWorkerPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ListWorkerPoolsRequest; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ListWorkerPoolsRequest; + + /** + * Verifies a ListWorkerPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkerPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ListWorkerPoolsRequest; + + /** + * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. + * @param message ListWorkerPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ListWorkerPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkerPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkerPoolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkerPoolsResponse. */ + interface IListWorkerPoolsResponse { + + /** ListWorkerPoolsResponse workerPools */ + workerPools?: (google.devtools.cloudbuild.v1.IWorkerPool[]|null); + + /** ListWorkerPoolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListWorkerPoolsResponse. */ + class ListWorkerPoolsResponse implements IListWorkerPoolsResponse { + + /** + * Constructs a new ListWorkerPoolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IListWorkerPoolsResponse); + + /** ListWorkerPoolsResponse workerPools. */ + public workerPools: google.devtools.cloudbuild.v1.IWorkerPool[]; + + /** ListWorkerPoolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListWorkerPoolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkerPoolsResponse instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IListWorkerPoolsResponse): google.devtools.cloudbuild.v1.ListWorkerPoolsResponse; + + /** + * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. + * @param message ListWorkerPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. + * @param message ListWorkerPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.ListWorkerPoolsResponse; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.ListWorkerPoolsResponse; + + /** + * Verifies a ListWorkerPoolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkerPoolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.ListWorkerPoolsResponse; + + /** + * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. + * @param message ListWorkerPoolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.ListWorkerPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkerPoolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkerPoolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateWorkerPoolOperationMetadata. */ + interface ICreateWorkerPoolOperationMetadata { + + /** CreateWorkerPoolOperationMetadata workerPool */ + workerPool?: (string|null); + + /** CreateWorkerPoolOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkerPoolOperationMetadata completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateWorkerPoolOperationMetadata. */ + class CreateWorkerPoolOperationMetadata implements ICreateWorkerPoolOperationMetadata { + + /** + * Constructs a new CreateWorkerPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata); + + /** CreateWorkerPoolOperationMetadata workerPool. */ + public workerPool: string; + + /** CreateWorkerPoolOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkerPoolOperationMetadata completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateWorkerPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkerPoolOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Encodes the specified CreateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message CreateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message CreateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Verifies a CreateWorkerPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkerPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Creates a plain object from a CreateWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @param message CreateWorkerPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkerPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkerPoolOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkerPoolOperationMetadata. */ + interface IUpdateWorkerPoolOperationMetadata { + + /** UpdateWorkerPoolOperationMetadata workerPool */ + workerPool?: (string|null); + + /** UpdateWorkerPoolOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** UpdateWorkerPoolOperationMetadata completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateWorkerPoolOperationMetadata. */ + class UpdateWorkerPoolOperationMetadata implements IUpdateWorkerPoolOperationMetadata { + + /** + * Constructs a new UpdateWorkerPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata); + + /** UpdateWorkerPoolOperationMetadata workerPool. */ + public workerPool: string; + + /** UpdateWorkerPoolOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** UpdateWorkerPoolOperationMetadata completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateWorkerPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkerPoolOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Encodes the specified UpdateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message UpdateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message UpdateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Verifies an UpdateWorkerPoolOperationMetadata message. + * @param message Plain 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 UpdateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkerPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Creates a plain object from an UpdateWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateWorkerPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkerPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkerPoolOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkerPoolOperationMetadata. */ + interface IDeleteWorkerPoolOperationMetadata { + + /** DeleteWorkerPoolOperationMetadata workerPool */ + workerPool?: (string|null); + + /** DeleteWorkerPoolOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeleteWorkerPoolOperationMetadata completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteWorkerPoolOperationMetadata. */ + class DeleteWorkerPoolOperationMetadata implements IDeleteWorkerPoolOperationMetadata { + + /** + * Constructs a new DeleteWorkerPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata); + + /** DeleteWorkerPoolOperationMetadata workerPool. */ + public workerPool: string; + + /** DeleteWorkerPoolOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeleteWorkerPoolOperationMetadata completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteWorkerPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkerPoolOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Encodes the specified DeleteWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. + * @param message DeleteWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. + * @param message DeleteWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Verifies a DeleteWorkerPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkerPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Creates a plain object from a DeleteWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteWorkerPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkerPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkerPoolOperationMetadata + * @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 HttpBody. */ + interface IHttpBody { + + /** HttpBody contentType */ + contentType?: (string|null); + + /** HttpBody data */ + data?: (Uint8Array|string|null); + + /** HttpBody extensions */ + extensions?: (google.protobuf.IAny[]|null); + } + + /** Represents a HttpBody. */ + class HttpBody implements IHttpBody { + + /** + * Constructs a new HttpBody. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpBody); + + /** HttpBody contentType. */ + public contentType: string; + + /** HttpBody data. */ + public data: (Uint8Array|string); + + /** HttpBody extensions. */ + public extensions: google.protobuf.IAny[]; + + /** + * Creates a new HttpBody instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpBody instance + */ + public static create(properties?: google.api.IHttpBody): google.api.HttpBody; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpBody + * @throws {Error} If the payload is not 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.HttpBody; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpBody + * @throws {Error} If the payload 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.HttpBody; + + /** + * Verifies a HttpBody message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpBody + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpBody; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @param message HttpBody + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpBody to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpBody + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-devtools-cloudbuild/protos/protos.js b/packages/google-devtools-cloudbuild/protos/protos.js new file mode 100644 index 000000000000..d750d27e63d3 --- /dev/null +++ b/packages/google-devtools-cloudbuild/protos/protos.js @@ -0,0 +1,36404 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_cloudbuild_protos || ($protobuf.roots._google_cloud_cloudbuild_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.devtools = (function() { + + /** + * Namespace devtools. + * @memberof google + * @namespace + */ + var devtools = {}; + + devtools.cloudbuild = (function() { + + /** + * Namespace cloudbuild. + * @memberof google.devtools + * @namespace + */ + var cloudbuild = {}; + + cloudbuild.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.devtools.cloudbuild + * @namespace + */ + var v1 = {}; + + v1.CloudBuild = (function() { + + /** + * Constructs a new CloudBuild service. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CloudBuild + * @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 CloudBuild(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudBuild.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudBuild; + + /** + * Creates new CloudBuild service using the specified rpc implementation. + * @function create + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @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 {CloudBuild} RPC service. Useful where requests and/or responses are streamed. + */ + CloudBuild.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|createBuild}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef CreateBuildCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBuild. + * @function createBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} request CreateBuildRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.CreateBuildCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.createBuild = function createBuild(request, callback) { + return this.rpcCall(createBuild, $root.google.devtools.cloudbuild.v1.CreateBuildRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBuild" }); + + /** + * Calls CreateBuild. + * @function createBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} request CreateBuildRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|getBuild}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef GetBuildCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.Build} [response] Build + */ + + /** + * Calls GetBuild. + * @function getBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} request GetBuildRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.GetBuildCallback} callback Node-style callback called with the error, if any, and Build + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.getBuild = function getBuild(request, callback) { + return this.rpcCall(getBuild, $root.google.devtools.cloudbuild.v1.GetBuildRequest, $root.google.devtools.cloudbuild.v1.Build, request, callback); + }, "name", { value: "GetBuild" }); + + /** + * Calls GetBuild. + * @function getBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} request GetBuildRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|listBuilds}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef ListBuildsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.ListBuildsResponse} [response] ListBuildsResponse + */ + + /** + * Calls ListBuilds. + * @function listBuilds + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} request ListBuildsRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.ListBuildsCallback} callback Node-style callback called with the error, if any, and ListBuildsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.listBuilds = function listBuilds(request, callback) { + return this.rpcCall(listBuilds, $root.google.devtools.cloudbuild.v1.ListBuildsRequest, $root.google.devtools.cloudbuild.v1.ListBuildsResponse, request, callback); + }, "name", { value: "ListBuilds" }); + + /** + * Calls ListBuilds. + * @function listBuilds + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} request ListBuildsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|cancelBuild}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef CancelBuildCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.Build} [response] Build + */ + + /** + * Calls CancelBuild. + * @function cancelBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} request CancelBuildRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.CancelBuildCallback} callback Node-style callback called with the error, if any, and Build + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.cancelBuild = function cancelBuild(request, callback) { + return this.rpcCall(cancelBuild, $root.google.devtools.cloudbuild.v1.CancelBuildRequest, $root.google.devtools.cloudbuild.v1.Build, request, callback); + }, "name", { value: "CancelBuild" }); + + /** + * Calls CancelBuild. + * @function cancelBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} request CancelBuildRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|retryBuild}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef RetryBuildCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RetryBuild. + * @function retryBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IRetryBuildRequest} request RetryBuildRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.RetryBuildCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.retryBuild = function retryBuild(request, callback) { + return this.rpcCall(retryBuild, $root.google.devtools.cloudbuild.v1.RetryBuildRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RetryBuild" }); + + /** + * Calls RetryBuild. + * @function retryBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IRetryBuildRequest} request RetryBuildRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|approveBuild}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef ApproveBuildCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApproveBuild. + * @function approveBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IApproveBuildRequest} request ApproveBuildRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.ApproveBuildCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.approveBuild = function approveBuild(request, callback) { + return this.rpcCall(approveBuild, $root.google.devtools.cloudbuild.v1.ApproveBuildRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApproveBuild" }); + + /** + * Calls ApproveBuild. + * @function approveBuild + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IApproveBuildRequest} request ApproveBuildRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|createBuildTrigger}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef CreateBuildTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.BuildTrigger} [response] BuildTrigger + */ + + /** + * Calls CreateBuildTrigger. + * @function createBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} request CreateBuildTriggerRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.CreateBuildTriggerCallback} callback Node-style callback called with the error, if any, and BuildTrigger + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.createBuildTrigger = function createBuildTrigger(request, callback) { + return this.rpcCall(createBuildTrigger, $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest, $root.google.devtools.cloudbuild.v1.BuildTrigger, request, callback); + }, "name", { value: "CreateBuildTrigger" }); + + /** + * Calls CreateBuildTrigger. + * @function createBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} request CreateBuildTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|getBuildTrigger}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef GetBuildTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.BuildTrigger} [response] BuildTrigger + */ + + /** + * Calls GetBuildTrigger. + * @function getBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} request GetBuildTriggerRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.GetBuildTriggerCallback} callback Node-style callback called with the error, if any, and BuildTrigger + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.getBuildTrigger = function getBuildTrigger(request, callback) { + return this.rpcCall(getBuildTrigger, $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest, $root.google.devtools.cloudbuild.v1.BuildTrigger, request, callback); + }, "name", { value: "GetBuildTrigger" }); + + /** + * Calls GetBuildTrigger. + * @function getBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} request GetBuildTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|listBuildTriggers}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef ListBuildTriggersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} [response] ListBuildTriggersResponse + */ + + /** + * Calls ListBuildTriggers. + * @function listBuildTriggers + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} request ListBuildTriggersRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.ListBuildTriggersCallback} callback Node-style callback called with the error, if any, and ListBuildTriggersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.listBuildTriggers = function listBuildTriggers(request, callback) { + return this.rpcCall(listBuildTriggers, $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest, $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse, request, callback); + }, "name", { value: "ListBuildTriggers" }); + + /** + * Calls ListBuildTriggers. + * @function listBuildTriggers + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} request ListBuildTriggersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|deleteBuildTrigger}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef DeleteBuildTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBuildTrigger. + * @function deleteBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} request DeleteBuildTriggerRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.DeleteBuildTriggerCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.deleteBuildTrigger = function deleteBuildTrigger(request, callback) { + return this.rpcCall(deleteBuildTrigger, $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBuildTrigger" }); + + /** + * Calls DeleteBuildTrigger. + * @function deleteBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} request DeleteBuildTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|updateBuildTrigger}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef UpdateBuildTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.BuildTrigger} [response] BuildTrigger + */ + + /** + * Calls UpdateBuildTrigger. + * @function updateBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} request UpdateBuildTriggerRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.UpdateBuildTriggerCallback} callback Node-style callback called with the error, if any, and BuildTrigger + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.updateBuildTrigger = function updateBuildTrigger(request, callback) { + return this.rpcCall(updateBuildTrigger, $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest, $root.google.devtools.cloudbuild.v1.BuildTrigger, request, callback); + }, "name", { value: "UpdateBuildTrigger" }); + + /** + * Calls UpdateBuildTrigger. + * @function updateBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} request UpdateBuildTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|runBuildTrigger}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef RunBuildTriggerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RunBuildTrigger. + * @function runBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IRunBuildTriggerRequest} request RunBuildTriggerRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.RunBuildTriggerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.runBuildTrigger = function runBuildTrigger(request, callback) { + return this.rpcCall(runBuildTrigger, $root.google.devtools.cloudbuild.v1.RunBuildTriggerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RunBuildTrigger" }); + + /** + * Calls RunBuildTrigger. + * @function runBuildTrigger + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IRunBuildTriggerRequest} request RunBuildTriggerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|receiveTriggerWebhook}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef ReceiveTriggerWebhookCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} [response] ReceiveTriggerWebhookResponse + */ + + /** + * Calls ReceiveTriggerWebhook. + * @function receiveTriggerWebhook + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} request ReceiveTriggerWebhookRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.ReceiveTriggerWebhookCallback} callback Node-style callback called with the error, if any, and ReceiveTriggerWebhookResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.receiveTriggerWebhook = function receiveTriggerWebhook(request, callback) { + return this.rpcCall(receiveTriggerWebhook, $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest, $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse, request, callback); + }, "name", { value: "ReceiveTriggerWebhook" }); + + /** + * Calls ReceiveTriggerWebhook. + * @function receiveTriggerWebhook + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} request ReceiveTriggerWebhookRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|createWorkerPool}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef CreateWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkerPool. + * @function createWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.createWorkerPool = function createWorkerPool(request, callback) { + return this.rpcCall(createWorkerPool, $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkerPool" }); + + /** + * Calls CreateWorkerPool. + * @function createWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|getWorkerPool}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef GetWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.WorkerPool} [response] WorkerPool + */ + + /** + * Calls GetWorkerPool. + * @function getWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.GetWorkerPoolCallback} callback Node-style callback called with the error, if any, and WorkerPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.getWorkerPool = function getWorkerPool(request, callback) { + return this.rpcCall(getWorkerPool, $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest, $root.google.devtools.cloudbuild.v1.WorkerPool, request, callback); + }, "name", { value: "GetWorkerPool" }); + + /** + * Calls GetWorkerPool. + * @function getWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} request GetWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|deleteWorkerPool}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef DeleteWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteWorkerPool. + * @function deleteWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.deleteWorkerPool = function deleteWorkerPool(request, callback) { + return this.rpcCall(deleteWorkerPool, $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteWorkerPool" }); + + /** + * Calls DeleteWorkerPool. + * @function deleteWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|updateWorkerPool}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef UpdateWorkerPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateWorkerPool. + * @function updateWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.updateWorkerPool = function updateWorkerPool(request, callback) { + return this.rpcCall(updateWorkerPool, $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateWorkerPool" }); + + /** + * Calls UpdateWorkerPool. + * @function updateWorkerPool + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild|listWorkerPools}. + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @typedef ListWorkerPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} [response] ListWorkerPoolsResponse + */ + + /** + * Calls ListWorkerPools. + * @function listWorkerPools + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object + * @param {google.devtools.cloudbuild.v1.CloudBuild.ListWorkerPoolsCallback} callback Node-style callback called with the error, if any, and ListWorkerPoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudBuild.prototype.listWorkerPools = function listWorkerPools(request, callback) { + return this.rpcCall(listWorkerPools, $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest, $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse, request, callback); + }, "name", { value: "ListWorkerPools" }); + + /** + * Calls ListWorkerPools. + * @function listWorkerPools + * @memberof google.devtools.cloudbuild.v1.CloudBuild + * @instance + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} request ListWorkerPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudBuild; + })(); + + v1.RetryBuildRequest = (function() { + + /** + * Properties of a RetryBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IRetryBuildRequest + * @property {string|null} [name] RetryBuildRequest name + * @property {string|null} [projectId] RetryBuildRequest projectId + * @property {string|null} [id] RetryBuildRequest id + */ + + /** + * Constructs a new RetryBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a RetryBuildRequest. + * @implements IRetryBuildRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IRetryBuildRequest=} [properties] Properties to set + */ + function RetryBuildRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetryBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @instance + */ + RetryBuildRequest.prototype.name = ""; + + /** + * RetryBuildRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @instance + */ + RetryBuildRequest.prototype.projectId = ""; + + /** + * RetryBuildRequest id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @instance + */ + RetryBuildRequest.prototype.id = ""; + + /** + * Creates a new RetryBuildRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IRetryBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.RetryBuildRequest} RetryBuildRequest instance + */ + RetryBuildRequest.create = function create(properties) { + return new RetryBuildRequest(properties); + }; + + /** + * Encodes the specified RetryBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.RetryBuildRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IRetryBuildRequest} message RetryBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryBuildRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified RetryBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.RetryBuildRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IRetryBuildRequest} message RetryBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetryBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetryBuildRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.RetryBuildRequest} RetryBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryBuildRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.RetryBuildRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetryBuildRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.RetryBuildRequest} RetryBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetryBuildRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetryBuildRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetryBuildRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a RetryBuildRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.RetryBuildRequest} RetryBuildRequest + */ + RetryBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.RetryBuildRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.RetryBuildRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a RetryBuildRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.RetryBuildRequest} message RetryBuildRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetryBuildRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.id = ""; + object.name = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this RetryBuildRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @instance + * @returns {Object.} JSON object + */ + RetryBuildRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetryBuildRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.RetryBuildRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetryBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.RetryBuildRequest"; + }; + + return RetryBuildRequest; + })(); + + v1.RunBuildTriggerRequest = (function() { + + /** + * Properties of a RunBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IRunBuildTriggerRequest + * @property {string|null} [name] RunBuildTriggerRequest name + * @property {string|null} [projectId] RunBuildTriggerRequest projectId + * @property {string|null} [triggerId] RunBuildTriggerRequest triggerId + * @property {google.devtools.cloudbuild.v1.IRepoSource|null} [source] RunBuildTriggerRequest source + */ + + /** + * Constructs a new RunBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a RunBuildTriggerRequest. + * @implements IRunBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IRunBuildTriggerRequest=} [properties] Properties to set + */ + function RunBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunBuildTriggerRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @instance + */ + RunBuildTriggerRequest.prototype.name = ""; + + /** + * RunBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @instance + */ + RunBuildTriggerRequest.prototype.projectId = ""; + + /** + * RunBuildTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @instance + */ + RunBuildTriggerRequest.prototype.triggerId = ""; + + /** + * RunBuildTriggerRequest source. + * @member {google.devtools.cloudbuild.v1.IRepoSource|null|undefined} source + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @instance + */ + RunBuildTriggerRequest.prototype.source = null; + + /** + * Creates a new RunBuildTriggerRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IRunBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.RunBuildTriggerRequest} RunBuildTriggerRequest instance + */ + RunBuildTriggerRequest.create = function create(properties) { + return new RunBuildTriggerRequest(properties); + }; + + /** + * Encodes the specified RunBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.RunBuildTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IRunBuildTriggerRequest} message RunBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunBuildTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.devtools.cloudbuild.v1.RepoSource.encode(message.source, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified RunBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.RunBuildTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IRunBuildTriggerRequest} message RunBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunBuildTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.RunBuildTriggerRequest} RunBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunBuildTriggerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.RunBuildTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.triggerId = reader.string(); + break; + } + case 3: { + message.source = $root.google.devtools.cloudbuild.v1.RepoSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.RunBuildTriggerRequest} RunBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunBuildTriggerRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunBuildTriggerRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.devtools.cloudbuild.v1.RepoSource.verify(message.source); + if (error) + return "source." + error; + } + return null; + }; + + /** + * Creates a RunBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.RunBuildTriggerRequest} RunBuildTriggerRequest + */ + RunBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.RunBuildTriggerRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.RunBuildTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.RunBuildTriggerRequest.source: object expected"); + message.source = $root.google.devtools.cloudbuild.v1.RepoSource.fromObject(object.source); + } + return message; + }; + + /** + * Creates a plain object from a RunBuildTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.RunBuildTriggerRequest} message RunBuildTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunBuildTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.triggerId = ""; + object.source = null; + object.name = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.devtools.cloudbuild.v1.RepoSource.toObject(message.source, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this RunBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + RunBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunBuildTriggerRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.RunBuildTriggerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunBuildTriggerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.RunBuildTriggerRequest"; + }; + + return RunBuildTriggerRequest; + })(); + + v1.StorageSource = (function() { + + /** + * Properties of a StorageSource. + * @memberof google.devtools.cloudbuild.v1 + * @interface IStorageSource + * @property {string|null} [bucket] StorageSource bucket + * @property {string|null} [object] StorageSource object + * @property {number|Long|null} [generation] StorageSource generation + */ + + /** + * Constructs a new StorageSource. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a StorageSource. + * @implements IStorageSource + * @constructor + * @param {google.devtools.cloudbuild.v1.IStorageSource=} [properties] Properties to set + */ + function StorageSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageSource bucket. + * @member {string} bucket + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @instance + */ + StorageSource.prototype.bucket = ""; + + /** + * StorageSource object. + * @member {string} object + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @instance + */ + StorageSource.prototype.object = ""; + + /** + * StorageSource generation. + * @member {number|Long} generation + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @instance + */ + StorageSource.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StorageSource instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {google.devtools.cloudbuild.v1.IStorageSource=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.StorageSource} StorageSource instance + */ + StorageSource.create = function create(properties) { + return new StorageSource(properties); + }; + + /** + * Encodes the specified StorageSource message. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSource.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {google.devtools.cloudbuild.v1.IStorageSource} message StorageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified StorageSource message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {google.devtools.cloudbuild.v1.IStorageSource} message StorageSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageSource message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.StorageSource} StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.StorageSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.StorageSource} StorageSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageSource message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + return null; + }; + + /** + * Creates a StorageSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.StorageSource} StorageSource + */ + StorageSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.StorageSource) + return object; + var message = new $root.google.devtools.cloudbuild.v1.StorageSource(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StorageSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {google.devtools.cloudbuild.v1.StorageSource} message StorageSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + return object; + }; + + /** + * Converts this StorageSource to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @instance + * @returns {Object.} JSON object + */ + StorageSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StorageSource + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.StorageSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.StorageSource"; + }; + + return StorageSource; + })(); + + v1.RepoSource = (function() { + + /** + * Properties of a RepoSource. + * @memberof google.devtools.cloudbuild.v1 + * @interface IRepoSource + * @property {string|null} [projectId] RepoSource projectId + * @property {string|null} [repoName] RepoSource repoName + * @property {string|null} [branchName] RepoSource branchName + * @property {string|null} [tagName] RepoSource tagName + * @property {string|null} [commitSha] RepoSource commitSha + * @property {string|null} [dir] RepoSource dir + * @property {boolean|null} [invertRegex] RepoSource invertRegex + * @property {Object.|null} [substitutions] RepoSource substitutions + */ + + /** + * Constructs a new RepoSource. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a RepoSource. + * @implements IRepoSource + * @constructor + * @param {google.devtools.cloudbuild.v1.IRepoSource=} [properties] Properties to set + */ + function RepoSource(properties) { + this.substitutions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepoSource projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.projectId = ""; + + /** + * RepoSource repoName. + * @member {string} repoName + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.repoName = ""; + + /** + * RepoSource branchName. + * @member {string|null|undefined} branchName + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.branchName = null; + + /** + * RepoSource tagName. + * @member {string|null|undefined} tagName + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.tagName = null; + + /** + * RepoSource commitSha. + * @member {string|null|undefined} commitSha + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.commitSha = null; + + /** + * RepoSource dir. + * @member {string} dir + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.dir = ""; + + /** + * RepoSource invertRegex. + * @member {boolean} invertRegex + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.invertRegex = false; + + /** + * RepoSource substitutions. + * @member {Object.} substitutions + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + RepoSource.prototype.substitutions = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RepoSource revision. + * @member {"branchName"|"tagName"|"commitSha"|undefined} revision + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + */ + Object.defineProperty(RepoSource.prototype, "revision", { + get: $util.oneOfGetter($oneOfFields = ["branchName", "tagName", "commitSha"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RepoSource instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {google.devtools.cloudbuild.v1.IRepoSource=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.RepoSource} RepoSource instance + */ + RepoSource.create = function create(properties) { + return new RepoSource(properties); + }; + + /** + * Encodes the specified RepoSource message. Does not implicitly {@link google.devtools.cloudbuild.v1.RepoSource.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {google.devtools.cloudbuild.v1.IRepoSource} message RepoSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepoSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.repoName != null && Object.hasOwnProperty.call(message, "repoName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.repoName); + if (message.branchName != null && Object.hasOwnProperty.call(message, "branchName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.branchName); + if (message.tagName != null && Object.hasOwnProperty.call(message, "tagName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tagName); + if (message.commitSha != null && Object.hasOwnProperty.call(message, "commitSha")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.commitSha); + if (message.dir != null && Object.hasOwnProperty.call(message, "dir")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.dir); + if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.invertRegex); + if (message.substitutions != null && Object.hasOwnProperty.call(message, "substitutions")) + for (var keys = Object.keys(message.substitutions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.substitutions[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepoSource message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.RepoSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {google.devtools.cloudbuild.v1.IRepoSource} message RepoSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepoSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepoSource message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.RepoSource} RepoSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepoSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.RepoSource(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.repoName = reader.string(); + break; + } + case 3: { + message.branchName = reader.string(); + break; + } + case 4: { + message.tagName = reader.string(); + break; + } + case 5: { + message.commitSha = reader.string(); + break; + } + case 7: { + message.dir = reader.string(); + break; + } + case 8: { + message.invertRegex = reader.bool(); + break; + } + case 9: { + if (message.substitutions === $util.emptyObject) + message.substitutions = {}; + 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.substitutions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepoSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.RepoSource} RepoSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepoSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepoSource message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepoSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.repoName != null && message.hasOwnProperty("repoName")) + if (!$util.isString(message.repoName)) + return "repoName: string expected"; + if (message.branchName != null && message.hasOwnProperty("branchName")) { + properties.revision = 1; + if (!$util.isString(message.branchName)) + return "branchName: string expected"; + } + if (message.tagName != null && message.hasOwnProperty("tagName")) { + if (properties.revision === 1) + return "revision: multiple values"; + properties.revision = 1; + if (!$util.isString(message.tagName)) + return "tagName: string expected"; + } + if (message.commitSha != null && message.hasOwnProperty("commitSha")) { + if (properties.revision === 1) + return "revision: multiple values"; + properties.revision = 1; + if (!$util.isString(message.commitSha)) + return "commitSha: string expected"; + } + if (message.dir != null && message.hasOwnProperty("dir")) + if (!$util.isString(message.dir)) + return "dir: string expected"; + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + if (typeof message.invertRegex !== "boolean") + return "invertRegex: boolean expected"; + if (message.substitutions != null && message.hasOwnProperty("substitutions")) { + if (!$util.isObject(message.substitutions)) + return "substitutions: object expected"; + var key = Object.keys(message.substitutions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.substitutions[key[i]])) + return "substitutions: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a RepoSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.RepoSource} RepoSource + */ + RepoSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.RepoSource) + return object; + var message = new $root.google.devtools.cloudbuild.v1.RepoSource(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.repoName != null) + message.repoName = String(object.repoName); + if (object.branchName != null) + message.branchName = String(object.branchName); + if (object.tagName != null) + message.tagName = String(object.tagName); + if (object.commitSha != null) + message.commitSha = String(object.commitSha); + if (object.dir != null) + message.dir = String(object.dir); + if (object.invertRegex != null) + message.invertRegex = Boolean(object.invertRegex); + if (object.substitutions) { + if (typeof object.substitutions !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.RepoSource.substitutions: object expected"); + message.substitutions = {}; + for (var keys = Object.keys(object.substitutions), i = 0; i < keys.length; ++i) + message.substitutions[keys[i]] = String(object.substitutions[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a RepoSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {google.devtools.cloudbuild.v1.RepoSource} message RepoSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepoSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.substitutions = {}; + if (options.defaults) { + object.projectId = ""; + object.repoName = ""; + object.dir = ""; + object.invertRegex = false; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.repoName != null && message.hasOwnProperty("repoName")) + object.repoName = message.repoName; + if (message.branchName != null && message.hasOwnProperty("branchName")) { + object.branchName = message.branchName; + if (options.oneofs) + object.revision = "branchName"; + } + if (message.tagName != null && message.hasOwnProperty("tagName")) { + object.tagName = message.tagName; + if (options.oneofs) + object.revision = "tagName"; + } + if (message.commitSha != null && message.hasOwnProperty("commitSha")) { + object.commitSha = message.commitSha; + if (options.oneofs) + object.revision = "commitSha"; + } + if (message.dir != null && message.hasOwnProperty("dir")) + object.dir = message.dir; + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + object.invertRegex = message.invertRegex; + var keys2; + if (message.substitutions && (keys2 = Object.keys(message.substitutions)).length) { + object.substitutions = {}; + for (var j = 0; j < keys2.length; ++j) + object.substitutions[keys2[j]] = message.substitutions[keys2[j]]; + } + return object; + }; + + /** + * Converts this RepoSource to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @instance + * @returns {Object.} JSON object + */ + RepoSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepoSource + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.RepoSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepoSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.RepoSource"; + }; + + return RepoSource; + })(); + + v1.StorageSourceManifest = (function() { + + /** + * Properties of a StorageSourceManifest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IStorageSourceManifest + * @property {string|null} [bucket] StorageSourceManifest bucket + * @property {string|null} [object] StorageSourceManifest object + * @property {number|Long|null} [generation] StorageSourceManifest generation + */ + + /** + * Constructs a new StorageSourceManifest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a StorageSourceManifest. + * @implements IStorageSourceManifest + * @constructor + * @param {google.devtools.cloudbuild.v1.IStorageSourceManifest=} [properties] Properties to set + */ + function StorageSourceManifest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StorageSourceManifest bucket. + * @member {string} bucket + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @instance + */ + StorageSourceManifest.prototype.bucket = ""; + + /** + * StorageSourceManifest object. + * @member {string} object + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @instance + */ + StorageSourceManifest.prototype.object = ""; + + /** + * StorageSourceManifest generation. + * @member {number|Long} generation + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @instance + */ + StorageSourceManifest.prototype.generation = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new StorageSourceManifest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {google.devtools.cloudbuild.v1.IStorageSourceManifest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.StorageSourceManifest} StorageSourceManifest instance + */ + StorageSourceManifest.create = function create(properties) { + return new StorageSourceManifest(properties); + }; + + /** + * Encodes the specified StorageSourceManifest message. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSourceManifest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {google.devtools.cloudbuild.v1.IStorageSourceManifest} message StorageSourceManifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageSourceManifest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucket != null && Object.hasOwnProperty.call(message, "bucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bucket); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.object); + if (message.generation != null && Object.hasOwnProperty.call(message, "generation")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.generation); + return writer; + }; + + /** + * Encodes the specified StorageSourceManifest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.StorageSourceManifest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {google.devtools.cloudbuild.v1.IStorageSourceManifest} message StorageSourceManifest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StorageSourceManifest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StorageSourceManifest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.StorageSourceManifest} StorageSourceManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageSourceManifest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.StorageSourceManifest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bucket = reader.string(); + break; + } + case 2: { + message.object = reader.string(); + break; + } + case 3: { + message.generation = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StorageSourceManifest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.StorageSourceManifest} StorageSourceManifest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StorageSourceManifest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StorageSourceManifest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StorageSourceManifest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bucket != null && message.hasOwnProperty("bucket")) + if (!$util.isString(message.bucket)) + return "bucket: string expected"; + if (message.object != null && message.hasOwnProperty("object")) + if (!$util.isString(message.object)) + return "object: string expected"; + if (message.generation != null && message.hasOwnProperty("generation")) + if (!$util.isInteger(message.generation) && !(message.generation && $util.isInteger(message.generation.low) && $util.isInteger(message.generation.high))) + return "generation: integer|Long expected"; + return null; + }; + + /** + * Creates a StorageSourceManifest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.StorageSourceManifest} StorageSourceManifest + */ + StorageSourceManifest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.StorageSourceManifest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.StorageSourceManifest(); + if (object.bucket != null) + message.bucket = String(object.bucket); + if (object.object != null) + message.object = String(object.object); + if (object.generation != null) + if ($util.Long) + (message.generation = $util.Long.fromValue(object.generation)).unsigned = false; + else if (typeof object.generation === "string") + message.generation = parseInt(object.generation, 10); + else if (typeof object.generation === "number") + message.generation = object.generation; + else if (typeof object.generation === "object") + message.generation = new $util.LongBits(object.generation.low >>> 0, object.generation.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a StorageSourceManifest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {google.devtools.cloudbuild.v1.StorageSourceManifest} message StorageSourceManifest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StorageSourceManifest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bucket = ""; + object.object = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.generation = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.generation = options.longs === String ? "0" : 0; + } + if (message.bucket != null && message.hasOwnProperty("bucket")) + object.bucket = message.bucket; + if (message.object != null && message.hasOwnProperty("object")) + object.object = message.object; + if (message.generation != null && message.hasOwnProperty("generation")) + if (typeof message.generation === "number") + object.generation = options.longs === String ? String(message.generation) : message.generation; + else + object.generation = options.longs === String ? $util.Long.prototype.toString.call(message.generation) : options.longs === Number ? new $util.LongBits(message.generation.low >>> 0, message.generation.high >>> 0).toNumber() : message.generation; + return object; + }; + + /** + * Converts this StorageSourceManifest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @instance + * @returns {Object.} JSON object + */ + StorageSourceManifest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StorageSourceManifest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.StorageSourceManifest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StorageSourceManifest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.StorageSourceManifest"; + }; + + return StorageSourceManifest; + })(); + + v1.Source = (function() { + + /** + * Properties of a Source. + * @memberof google.devtools.cloudbuild.v1 + * @interface ISource + * @property {google.devtools.cloudbuild.v1.IStorageSource|null} [storageSource] Source storageSource + * @property {google.devtools.cloudbuild.v1.IRepoSource|null} [repoSource] Source repoSource + * @property {google.devtools.cloudbuild.v1.IStorageSourceManifest|null} [storageSourceManifest] Source storageSourceManifest + */ + + /** + * Constructs a new Source. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Source. + * @implements ISource + * @constructor + * @param {google.devtools.cloudbuild.v1.ISource=} [properties] Properties to set + */ + function Source(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Source storageSource. + * @member {google.devtools.cloudbuild.v1.IStorageSource|null|undefined} storageSource + * @memberof google.devtools.cloudbuild.v1.Source + * @instance + */ + Source.prototype.storageSource = null; + + /** + * Source repoSource. + * @member {google.devtools.cloudbuild.v1.IRepoSource|null|undefined} repoSource + * @memberof google.devtools.cloudbuild.v1.Source + * @instance + */ + Source.prototype.repoSource = null; + + /** + * Source storageSourceManifest. + * @member {google.devtools.cloudbuild.v1.IStorageSourceManifest|null|undefined} storageSourceManifest + * @memberof google.devtools.cloudbuild.v1.Source + * @instance + */ + Source.prototype.storageSourceManifest = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Source source. + * @member {"storageSource"|"repoSource"|"storageSourceManifest"|undefined} source + * @memberof google.devtools.cloudbuild.v1.Source + * @instance + */ + Object.defineProperty(Source.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["storageSource", "repoSource", "storageSourceManifest"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Source instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {google.devtools.cloudbuild.v1.ISource=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Source} Source instance + */ + Source.create = function create(properties) { + return new Source(properties); + }; + + /** + * Encodes the specified Source message. Does not implicitly {@link google.devtools.cloudbuild.v1.Source.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {google.devtools.cloudbuild.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storageSource != null && Object.hasOwnProperty.call(message, "storageSource")) + $root.google.devtools.cloudbuild.v1.StorageSource.encode(message.storageSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.repoSource != null && Object.hasOwnProperty.call(message, "repoSource")) + $root.google.devtools.cloudbuild.v1.RepoSource.encode(message.repoSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.storageSourceManifest != null && Object.hasOwnProperty.call(message, "storageSourceManifest")) + $root.google.devtools.cloudbuild.v1.StorageSourceManifest.encode(message.storageSourceManifest, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Source.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {google.devtools.cloudbuild.v1.ISource} message Source message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Source.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Source message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Source(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.storageSource = $root.google.devtools.cloudbuild.v1.StorageSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.repoSource = $root.google.devtools.cloudbuild.v1.RepoSource.decode(reader, reader.uint32()); + break; + } + case 8: { + message.storageSourceManifest = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Source} Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Source.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Source message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Source.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.storageSource != null && message.hasOwnProperty("storageSource")) { + properties.source = 1; + { + var error = $root.google.devtools.cloudbuild.v1.StorageSource.verify(message.storageSource); + if (error) + return "storageSource." + error; + } + } + if (message.repoSource != null && message.hasOwnProperty("repoSource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.devtools.cloudbuild.v1.RepoSource.verify(message.repoSource); + if (error) + return "repoSource." + error; + } + } + if (message.storageSourceManifest != null && message.hasOwnProperty("storageSourceManifest")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.verify(message.storageSourceManifest); + if (error) + return "storageSourceManifest." + error; + } + } + return null; + }; + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Source} Source + */ + Source.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Source) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Source(); + if (object.storageSource != null) { + if (typeof object.storageSource !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Source.storageSource: object expected"); + message.storageSource = $root.google.devtools.cloudbuild.v1.StorageSource.fromObject(object.storageSource); + } + if (object.repoSource != null) { + if (typeof object.repoSource !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Source.repoSource: object expected"); + message.repoSource = $root.google.devtools.cloudbuild.v1.RepoSource.fromObject(object.repoSource); + } + if (object.storageSourceManifest != null) { + if (typeof object.storageSourceManifest !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Source.storageSourceManifest: object expected"); + message.storageSourceManifest = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.fromObject(object.storageSourceManifest); + } + return message; + }; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {google.devtools.cloudbuild.v1.Source} message Source + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Source.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.storageSource != null && message.hasOwnProperty("storageSource")) { + object.storageSource = $root.google.devtools.cloudbuild.v1.StorageSource.toObject(message.storageSource, options); + if (options.oneofs) + object.source = "storageSource"; + } + if (message.repoSource != null && message.hasOwnProperty("repoSource")) { + object.repoSource = $root.google.devtools.cloudbuild.v1.RepoSource.toObject(message.repoSource, options); + if (options.oneofs) + object.source = "repoSource"; + } + if (message.storageSourceManifest != null && message.hasOwnProperty("storageSourceManifest")) { + object.storageSourceManifest = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.toObject(message.storageSourceManifest, options); + if (options.oneofs) + object.source = "storageSourceManifest"; + } + return object; + }; + + /** + * Converts this Source to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Source + * @instance + * @returns {Object.} JSON object + */ + Source.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Source + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Source + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Source.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Source"; + }; + + return Source; + })(); + + v1.BuiltImage = (function() { + + /** + * Properties of a BuiltImage. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuiltImage + * @property {string|null} [name] BuiltImage name + * @property {string|null} [digest] BuiltImage digest + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [pushTiming] BuiltImage pushTiming + */ + + /** + * Constructs a new BuiltImage. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuiltImage. + * @implements IBuiltImage + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuiltImage=} [properties] Properties to set + */ + function BuiltImage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuiltImage name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @instance + */ + BuiltImage.prototype.name = ""; + + /** + * BuiltImage digest. + * @member {string} digest + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @instance + */ + BuiltImage.prototype.digest = ""; + + /** + * BuiltImage pushTiming. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} pushTiming + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @instance + */ + BuiltImage.prototype.pushTiming = null; + + /** + * Creates a new BuiltImage instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {google.devtools.cloudbuild.v1.IBuiltImage=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuiltImage} BuiltImage instance + */ + BuiltImage.create = function create(properties) { + return new BuiltImage(properties); + }; + + /** + * Encodes the specified BuiltImage message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuiltImage.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {google.devtools.cloudbuild.v1.IBuiltImage} message BuiltImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuiltImage.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.digest != null && Object.hasOwnProperty.call(message, "digest")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.digest); + if (message.pushTiming != null && Object.hasOwnProperty.call(message, "pushTiming")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.pushTiming, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BuiltImage message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuiltImage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {google.devtools.cloudbuild.v1.IBuiltImage} message BuiltImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuiltImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuiltImage message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuiltImage} BuiltImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuiltImage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuiltImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.digest = reader.string(); + break; + } + case 4: { + message.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuiltImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuiltImage} BuiltImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuiltImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuiltImage message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuiltImage.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.digest != null && message.hasOwnProperty("digest")) + if (!$util.isString(message.digest)) + return "digest: string expected"; + if (message.pushTiming != null && message.hasOwnProperty("pushTiming")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.pushTiming); + if (error) + return "pushTiming." + error; + } + return null; + }; + + /** + * Creates a BuiltImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuiltImage} BuiltImage + */ + BuiltImage.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuiltImage) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuiltImage(); + if (object.name != null) + message.name = String(object.name); + if (object.digest != null) + message.digest = String(object.digest); + if (object.pushTiming != null) { + if (typeof object.pushTiming !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuiltImage.pushTiming: object expected"); + message.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.pushTiming); + } + return message; + }; + + /** + * Creates a plain object from a BuiltImage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {google.devtools.cloudbuild.v1.BuiltImage} message BuiltImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuiltImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.digest = ""; + object.pushTiming = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.digest != null && message.hasOwnProperty("digest")) + object.digest = message.digest; + if (message.pushTiming != null && message.hasOwnProperty("pushTiming")) + object.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.pushTiming, options); + return object; + }; + + /** + * Converts this BuiltImage to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @instance + * @returns {Object.} JSON object + */ + BuiltImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuiltImage + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuiltImage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuiltImage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuiltImage"; + }; + + return BuiltImage; + })(); + + v1.UploadedPythonPackage = (function() { + + /** + * Properties of an UploadedPythonPackage. + * @memberof google.devtools.cloudbuild.v1 + * @interface IUploadedPythonPackage + * @property {string|null} [uri] UploadedPythonPackage uri + * @property {google.devtools.cloudbuild.v1.IFileHashes|null} [fileHashes] UploadedPythonPackage fileHashes + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [pushTiming] UploadedPythonPackage pushTiming + */ + + /** + * Constructs a new UploadedPythonPackage. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an UploadedPythonPackage. + * @implements IUploadedPythonPackage + * @constructor + * @param {google.devtools.cloudbuild.v1.IUploadedPythonPackage=} [properties] Properties to set + */ + function UploadedPythonPackage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadedPythonPackage uri. + * @member {string} uri + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @instance + */ + UploadedPythonPackage.prototype.uri = ""; + + /** + * UploadedPythonPackage fileHashes. + * @member {google.devtools.cloudbuild.v1.IFileHashes|null|undefined} fileHashes + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @instance + */ + UploadedPythonPackage.prototype.fileHashes = null; + + /** + * UploadedPythonPackage pushTiming. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} pushTiming + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @instance + */ + UploadedPythonPackage.prototype.pushTiming = null; + + /** + * Creates a new UploadedPythonPackage instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.IUploadedPythonPackage=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UploadedPythonPackage} UploadedPythonPackage instance + */ + UploadedPythonPackage.create = function create(properties) { + return new UploadedPythonPackage(properties); + }; + + /** + * Encodes the specified UploadedPythonPackage message. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedPythonPackage.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.IUploadedPythonPackage} message UploadedPythonPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadedPythonPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.fileHashes != null && Object.hasOwnProperty.call(message, "fileHashes")) + $root.google.devtools.cloudbuild.v1.FileHashes.encode(message.fileHashes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pushTiming != null && Object.hasOwnProperty.call(message, "pushTiming")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.pushTiming, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UploadedPythonPackage message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedPythonPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.IUploadedPythonPackage} message UploadedPythonPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadedPythonPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadedPythonPackage message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.UploadedPythonPackage} UploadedPythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadedPythonPackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UploadedPythonPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.fileHashes = $root.google.devtools.cloudbuild.v1.FileHashes.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadedPythonPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.UploadedPythonPackage} UploadedPythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadedPythonPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadedPythonPackage message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadedPythonPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) { + var error = $root.google.devtools.cloudbuild.v1.FileHashes.verify(message.fileHashes); + if (error) + return "fileHashes." + error; + } + if (message.pushTiming != null && message.hasOwnProperty("pushTiming")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.pushTiming); + if (error) + return "pushTiming." + error; + } + return null; + }; + + /** + * Creates an UploadedPythonPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.UploadedPythonPackage} UploadedPythonPackage + */ + UploadedPythonPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UploadedPythonPackage) + return object; + var message = new $root.google.devtools.cloudbuild.v1.UploadedPythonPackage(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.fileHashes != null) { + if (typeof object.fileHashes !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UploadedPythonPackage.fileHashes: object expected"); + message.fileHashes = $root.google.devtools.cloudbuild.v1.FileHashes.fromObject(object.fileHashes); + } + if (object.pushTiming != null) { + if (typeof object.pushTiming !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UploadedPythonPackage.pushTiming: object expected"); + message.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.pushTiming); + } + return message; + }; + + /** + * Creates a plain object from an UploadedPythonPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.UploadedPythonPackage} message UploadedPythonPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadedPythonPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.fileHashes = null; + object.pushTiming = null; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) + object.fileHashes = $root.google.devtools.cloudbuild.v1.FileHashes.toObject(message.fileHashes, options); + if (message.pushTiming != null && message.hasOwnProperty("pushTiming")) + object.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.pushTiming, options); + return object; + }; + + /** + * Converts this UploadedPythonPackage to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @instance + * @returns {Object.} JSON object + */ + UploadedPythonPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadedPythonPackage + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.UploadedPythonPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadedPythonPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.UploadedPythonPackage"; + }; + + return UploadedPythonPackage; + })(); + + v1.UploadedMavenArtifact = (function() { + + /** + * Properties of an UploadedMavenArtifact. + * @memberof google.devtools.cloudbuild.v1 + * @interface IUploadedMavenArtifact + * @property {string|null} [uri] UploadedMavenArtifact uri + * @property {google.devtools.cloudbuild.v1.IFileHashes|null} [fileHashes] UploadedMavenArtifact fileHashes + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [pushTiming] UploadedMavenArtifact pushTiming + */ + + /** + * Constructs a new UploadedMavenArtifact. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an UploadedMavenArtifact. + * @implements IUploadedMavenArtifact + * @constructor + * @param {google.devtools.cloudbuild.v1.IUploadedMavenArtifact=} [properties] Properties to set + */ + function UploadedMavenArtifact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UploadedMavenArtifact uri. + * @member {string} uri + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @instance + */ + UploadedMavenArtifact.prototype.uri = ""; + + /** + * UploadedMavenArtifact fileHashes. + * @member {google.devtools.cloudbuild.v1.IFileHashes|null|undefined} fileHashes + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @instance + */ + UploadedMavenArtifact.prototype.fileHashes = null; + + /** + * UploadedMavenArtifact pushTiming. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} pushTiming + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @instance + */ + UploadedMavenArtifact.prototype.pushTiming = null; + + /** + * Creates a new UploadedMavenArtifact instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.IUploadedMavenArtifact=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UploadedMavenArtifact} UploadedMavenArtifact instance + */ + UploadedMavenArtifact.create = function create(properties) { + return new UploadedMavenArtifact(properties); + }; + + /** + * Encodes the specified UploadedMavenArtifact message. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedMavenArtifact.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.IUploadedMavenArtifact} message UploadedMavenArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadedMavenArtifact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.fileHashes != null && Object.hasOwnProperty.call(message, "fileHashes")) + $root.google.devtools.cloudbuild.v1.FileHashes.encode(message.fileHashes, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pushTiming != null && Object.hasOwnProperty.call(message, "pushTiming")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.pushTiming, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UploadedMavenArtifact message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UploadedMavenArtifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.IUploadedMavenArtifact} message UploadedMavenArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UploadedMavenArtifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UploadedMavenArtifact message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.UploadedMavenArtifact} UploadedMavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadedMavenArtifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.fileHashes = $root.google.devtools.cloudbuild.v1.FileHashes.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UploadedMavenArtifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.UploadedMavenArtifact} UploadedMavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UploadedMavenArtifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UploadedMavenArtifact message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UploadedMavenArtifact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) { + var error = $root.google.devtools.cloudbuild.v1.FileHashes.verify(message.fileHashes); + if (error) + return "fileHashes." + error; + } + if (message.pushTiming != null && message.hasOwnProperty("pushTiming")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.pushTiming); + if (error) + return "pushTiming." + error; + } + return null; + }; + + /** + * Creates an UploadedMavenArtifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.UploadedMavenArtifact} UploadedMavenArtifact + */ + UploadedMavenArtifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact) + return object; + var message = new $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.fileHashes != null) { + if (typeof object.fileHashes !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UploadedMavenArtifact.fileHashes: object expected"); + message.fileHashes = $root.google.devtools.cloudbuild.v1.FileHashes.fromObject(object.fileHashes); + } + if (object.pushTiming != null) { + if (typeof object.pushTiming !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UploadedMavenArtifact.pushTiming: object expected"); + message.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.pushTiming); + } + return message; + }; + + /** + * Creates a plain object from an UploadedMavenArtifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.UploadedMavenArtifact} message UploadedMavenArtifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UploadedMavenArtifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.fileHashes = null; + object.pushTiming = null; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) + object.fileHashes = $root.google.devtools.cloudbuild.v1.FileHashes.toObject(message.fileHashes, options); + if (message.pushTiming != null && message.hasOwnProperty("pushTiming")) + object.pushTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.pushTiming, options); + return object; + }; + + /** + * Converts this UploadedMavenArtifact to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @instance + * @returns {Object.} JSON object + */ + UploadedMavenArtifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UploadedMavenArtifact + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.UploadedMavenArtifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UploadedMavenArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.UploadedMavenArtifact"; + }; + + return UploadedMavenArtifact; + })(); + + v1.BuildStep = (function() { + + /** + * Properties of a BuildStep. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuildStep + * @property {string|null} [name] BuildStep name + * @property {Array.|null} [env] BuildStep env + * @property {Array.|null} [args] BuildStep args + * @property {string|null} [dir] BuildStep dir + * @property {string|null} [id] BuildStep id + * @property {Array.|null} [waitFor] BuildStep waitFor + * @property {string|null} [entrypoint] BuildStep entrypoint + * @property {Array.|null} [secretEnv] BuildStep secretEnv + * @property {Array.|null} [volumes] BuildStep volumes + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [timing] BuildStep timing + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [pullTiming] BuildStep pullTiming + * @property {google.protobuf.IDuration|null} [timeout] BuildStep timeout + * @property {google.devtools.cloudbuild.v1.Build.Status|null} [status] BuildStep status + * @property {boolean|null} [allowFailure] BuildStep allowFailure + * @property {number|null} [exitCode] BuildStep exitCode + * @property {Array.|null} [allowExitCodes] BuildStep allowExitCodes + * @property {string|null} [script] BuildStep script + */ + + /** + * Constructs a new BuildStep. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuildStep. + * @implements IBuildStep + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuildStep=} [properties] Properties to set + */ + function BuildStep(properties) { + this.env = []; + this.args = []; + this.waitFor = []; + this.secretEnv = []; + this.volumes = []; + this.allowExitCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildStep name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.name = ""; + + /** + * BuildStep env. + * @member {Array.} env + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.env = $util.emptyArray; + + /** + * BuildStep args. + * @member {Array.} args + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.args = $util.emptyArray; + + /** + * BuildStep dir. + * @member {string} dir + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.dir = ""; + + /** + * BuildStep id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.id = ""; + + /** + * BuildStep waitFor. + * @member {Array.} waitFor + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.waitFor = $util.emptyArray; + + /** + * BuildStep entrypoint. + * @member {string} entrypoint + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.entrypoint = ""; + + /** + * BuildStep secretEnv. + * @member {Array.} secretEnv + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.secretEnv = $util.emptyArray; + + /** + * BuildStep volumes. + * @member {Array.} volumes + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.volumes = $util.emptyArray; + + /** + * BuildStep timing. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} timing + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.timing = null; + + /** + * BuildStep pullTiming. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} pullTiming + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.pullTiming = null; + + /** + * BuildStep timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.timeout = null; + + /** + * BuildStep status. + * @member {google.devtools.cloudbuild.v1.Build.Status} status + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.status = 0; + + /** + * BuildStep allowFailure. + * @member {boolean} allowFailure + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.allowFailure = false; + + /** + * BuildStep exitCode. + * @member {number} exitCode + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.exitCode = 0; + + /** + * BuildStep allowExitCodes. + * @member {Array.} allowExitCodes + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.allowExitCodes = $util.emptyArray; + + /** + * BuildStep script. + * @member {string} script + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + */ + BuildStep.prototype.script = ""; + + /** + * Creates a new BuildStep instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {google.devtools.cloudbuild.v1.IBuildStep=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildStep} BuildStep instance + */ + BuildStep.create = function create(properties) { + return new BuildStep(properties); + }; + + /** + * Encodes the specified BuildStep message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildStep.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {google.devtools.cloudbuild.v1.IBuildStep} message BuildStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildStep.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.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.env[i]); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.dir != null && Object.hasOwnProperty.call(message, "dir")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dir); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.id); + if (message.waitFor != null && message.waitFor.length) + for (var i = 0; i < message.waitFor.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.waitFor[i]); + if (message.entrypoint != null && Object.hasOwnProperty.call(message, "entrypoint")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.entrypoint); + if (message.secretEnv != null && message.secretEnv.length) + for (var i = 0; i < message.secretEnv.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.secretEnv[i]); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.devtools.cloudbuild.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timing != null && Object.hasOwnProperty.call(message, "timing")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.timing, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.status); + if (message.pullTiming != null && Object.hasOwnProperty.call(message, "pullTiming")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.pullTiming, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.allowFailure != null && Object.hasOwnProperty.call(message, "allowFailure")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.allowFailure); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.exitCode); + if (message.allowExitCodes != null && message.allowExitCodes.length) { + writer.uint32(/* id 18, wireType 2 =*/146).fork(); + for (var i = 0; i < message.allowExitCodes.length; ++i) + writer.int32(message.allowExitCodes[i]); + writer.ldelim(); + } + if (message.script != null && Object.hasOwnProperty.call(message, "script")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.script); + return writer; + }; + + /** + * Encodes the specified BuildStep message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildStep.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {google.devtools.cloudbuild.v1.IBuildStep} message BuildStep message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildStep.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildStep message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildStep} BuildStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildStep.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildStep(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push(reader.string()); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + message.dir = reader.string(); + break; + } + case 5: { + message.id = reader.string(); + break; + } + case 6: { + if (!(message.waitFor && message.waitFor.length)) + message.waitFor = []; + message.waitFor.push(reader.string()); + break; + } + case 7: { + message.entrypoint = reader.string(); + break; + } + case 8: { + if (!(message.secretEnv && message.secretEnv.length)) + message.secretEnv = []; + message.secretEnv.push(reader.string()); + break; + } + case 9: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.devtools.cloudbuild.v1.Volume.decode(reader, reader.uint32())); + break; + } + case 10: { + message.timing = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + case 13: { + message.pullTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + case 11: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 12: { + message.status = reader.int32(); + break; + } + case 14: { + message.allowFailure = reader.bool(); + break; + } + case 16: { + message.exitCode = reader.int32(); + break; + } + case 18: { + if (!(message.allowExitCodes && message.allowExitCodes.length)) + message.allowExitCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowExitCodes.push(reader.int32()); + } else + message.allowExitCodes.push(reader.int32()); + break; + } + case 19: { + message.script = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildStep message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildStep} BuildStep + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildStep.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildStep message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildStep.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.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) + if (!$util.isString(message.env[i])) + return "env: string[] expected"; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.dir != null && message.hasOwnProperty("dir")) + if (!$util.isString(message.dir)) + return "dir: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.waitFor != null && message.hasOwnProperty("waitFor")) { + if (!Array.isArray(message.waitFor)) + return "waitFor: array expected"; + for (var i = 0; i < message.waitFor.length; ++i) + if (!$util.isString(message.waitFor[i])) + return "waitFor: string[] expected"; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + if (!$util.isString(message.entrypoint)) + return "entrypoint: string expected"; + if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { + if (!Array.isArray(message.secretEnv)) + return "secretEnv: array expected"; + for (var i = 0; i < message.secretEnv.length; ++i) + if (!$util.isString(message.secretEnv[i])) + return "secretEnv: string[] expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + if (message.timing != null && message.hasOwnProperty("timing")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.timing); + if (error) + return "timing." + error; + } + if (message.pullTiming != null && message.hasOwnProperty("pullTiming")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.pullTiming); + if (error) + return "pullTiming." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 10: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 9: + break; + } + if (message.allowFailure != null && message.hasOwnProperty("allowFailure")) + if (typeof message.allowFailure !== "boolean") + return "allowFailure: boolean expected"; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + if (!$util.isInteger(message.exitCode)) + return "exitCode: integer expected"; + if (message.allowExitCodes != null && message.hasOwnProperty("allowExitCodes")) { + if (!Array.isArray(message.allowExitCodes)) + return "allowExitCodes: array expected"; + for (var i = 0; i < message.allowExitCodes.length; ++i) + if (!$util.isInteger(message.allowExitCodes[i])) + return "allowExitCodes: integer[] expected"; + } + if (message.script != null && message.hasOwnProperty("script")) + if (!$util.isString(message.script)) + return "script: string expected"; + return null; + }; + + /** + * Creates a BuildStep message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildStep} BuildStep + */ + BuildStep.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildStep) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildStep(); + if (object.name != null) + message.name = String(object.name); + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) + message.env[i] = String(object.env[i]); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.dir != null) + message.dir = String(object.dir); + if (object.id != null) + message.id = String(object.id); + if (object.waitFor) { + if (!Array.isArray(object.waitFor)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.waitFor: array expected"); + message.waitFor = []; + for (var i = 0; i < object.waitFor.length; ++i) + message.waitFor[i] = String(object.waitFor[i]); + } + if (object.entrypoint != null) + message.entrypoint = String(object.entrypoint); + if (object.secretEnv) { + if (!Array.isArray(object.secretEnv)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.secretEnv: array expected"); + message.secretEnv = []; + for (var i = 0; i < object.secretEnv.length; ++i) + message.secretEnv[i] = String(object.secretEnv[i]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.volumes: object expected"); + message.volumes[i] = $root.google.devtools.cloudbuild.v1.Volume.fromObject(object.volumes[i]); + } + } + if (object.timing != null) { + if (typeof object.timing !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.timing: object expected"); + message.timing = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.timing); + } + if (object.pullTiming != null) { + if (typeof object.pullTiming !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.pullTiming: object expected"); + message.pullTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.pullTiming); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNKNOWN": + case 0: + message.status = 0; + break; + case "PENDING": + case 10: + message.status = 10; + break; + case "QUEUED": + case 1: + message.status = 1; + break; + case "WORKING": + case 2: + message.status = 2; + break; + case "SUCCESS": + case 3: + message.status = 3; + break; + case "FAILURE": + case 4: + message.status = 4; + break; + case "INTERNAL_ERROR": + case 5: + message.status = 5; + break; + case "TIMEOUT": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + case "EXPIRED": + case 9: + message.status = 9; + break; + } + if (object.allowFailure != null) + message.allowFailure = Boolean(object.allowFailure); + if (object.exitCode != null) + message.exitCode = object.exitCode | 0; + if (object.allowExitCodes) { + if (!Array.isArray(object.allowExitCodes)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildStep.allowExitCodes: array expected"); + message.allowExitCodes = []; + for (var i = 0; i < object.allowExitCodes.length; ++i) + message.allowExitCodes[i] = object.allowExitCodes[i] | 0; + } + if (object.script != null) + message.script = String(object.script); + return message; + }; + + /** + * Creates a plain object from a BuildStep message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {google.devtools.cloudbuild.v1.BuildStep} message BuildStep + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildStep.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.env = []; + object.args = []; + object.waitFor = []; + object.secretEnv = []; + object.volumes = []; + object.allowExitCodes = []; + } + if (options.defaults) { + object.name = ""; + object.dir = ""; + object.id = ""; + object.entrypoint = ""; + object.timing = null; + object.timeout = null; + object.status = options.enums === String ? "STATUS_UNKNOWN" : 0; + object.pullTiming = null; + object.allowFailure = false; + object.exitCode = 0; + object.script = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = message.env[j]; + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.dir != null && message.hasOwnProperty("dir")) + object.dir = message.dir; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.waitFor && message.waitFor.length) { + object.waitFor = []; + for (var j = 0; j < message.waitFor.length; ++j) + object.waitFor[j] = message.waitFor[j]; + } + if (message.entrypoint != null && message.hasOwnProperty("entrypoint")) + object.entrypoint = message.entrypoint; + if (message.secretEnv && message.secretEnv.length) { + object.secretEnv = []; + for (var j = 0; j < message.secretEnv.length; ++j) + object.secretEnv[j] = message.secretEnv[j]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.devtools.cloudbuild.v1.Volume.toObject(message.volumes[j], options); + } + if (message.timing != null && message.hasOwnProperty("timing")) + object.timing = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.timing, options); + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.devtools.cloudbuild.v1.Build.Status[message.status] === undefined ? message.status : $root.google.devtools.cloudbuild.v1.Build.Status[message.status] : message.status; + if (message.pullTiming != null && message.hasOwnProperty("pullTiming")) + object.pullTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.pullTiming, options); + if (message.allowFailure != null && message.hasOwnProperty("allowFailure")) + object.allowFailure = message.allowFailure; + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = message.exitCode; + if (message.allowExitCodes && message.allowExitCodes.length) { + object.allowExitCodes = []; + for (var j = 0; j < message.allowExitCodes.length; ++j) + object.allowExitCodes[j] = message.allowExitCodes[j]; + } + if (message.script != null && message.hasOwnProperty("script")) + object.script = message.script; + return object; + }; + + /** + * Converts this BuildStep to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @instance + * @returns {Object.} JSON object + */ + BuildStep.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildStep + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuildStep + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildStep.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuildStep"; + }; + + return BuildStep; + })(); + + v1.Volume = (function() { + + /** + * Properties of a Volume. + * @memberof google.devtools.cloudbuild.v1 + * @interface IVolume + * @property {string|null} [name] Volume name + * @property {string|null} [path] Volume path + */ + + /** + * Constructs a new Volume. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Volume. + * @implements IVolume + * @constructor + * @param {google.devtools.cloudbuild.v1.IVolume=} [properties] Properties to set + */ + function Volume(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Volume name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.Volume + * @instance + */ + Volume.prototype.name = ""; + + /** + * Volume path. + * @member {string} path + * @memberof google.devtools.cloudbuild.v1.Volume + * @instance + */ + Volume.prototype.path = ""; + + /** + * Creates a new Volume instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {google.devtools.cloudbuild.v1.IVolume=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Volume} Volume instance + */ + Volume.create = function create(properties) { + return new Volume(properties); + }; + + /** + * Encodes the specified Volume message. Does not implicitly {@link google.devtools.cloudbuild.v1.Volume.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {google.devtools.cloudbuild.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.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.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified Volume message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Volume.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {google.devtools.cloudbuild.v1.IVolume} message Volume message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Volume.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Volume message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Volume(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Volume message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Volume} Volume + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Volume.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Volume message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Volume.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.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a Volume message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Volume} Volume + */ + Volume.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Volume) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Volume(); + if (object.name != null) + message.name = String(object.name); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a Volume message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {google.devtools.cloudbuild.v1.Volume} message Volume + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Volume.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.path = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this Volume to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Volume + * @instance + * @returns {Object.} JSON object + */ + Volume.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Volume + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Volume + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Volume.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Volume"; + }; + + return Volume; + })(); + + v1.Results = (function() { + + /** + * Properties of a Results. + * @memberof google.devtools.cloudbuild.v1 + * @interface IResults + * @property {Array.|null} [images] Results images + * @property {Array.|null} [buildStepImages] Results buildStepImages + * @property {string|null} [artifactManifest] Results artifactManifest + * @property {number|Long|null} [numArtifacts] Results numArtifacts + * @property {Array.|null} [buildStepOutputs] Results buildStepOutputs + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [artifactTiming] Results artifactTiming + * @property {Array.|null} [pythonPackages] Results pythonPackages + * @property {Array.|null} [mavenArtifacts] Results mavenArtifacts + */ + + /** + * Constructs a new Results. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Results. + * @implements IResults + * @constructor + * @param {google.devtools.cloudbuild.v1.IResults=} [properties] Properties to set + */ + function Results(properties) { + this.images = []; + this.buildStepImages = []; + this.buildStepOutputs = []; + this.pythonPackages = []; + this.mavenArtifacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Results images. + * @member {Array.} images + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.images = $util.emptyArray; + + /** + * Results buildStepImages. + * @member {Array.} buildStepImages + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.buildStepImages = $util.emptyArray; + + /** + * Results artifactManifest. + * @member {string} artifactManifest + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.artifactManifest = ""; + + /** + * Results numArtifacts. + * @member {number|Long} numArtifacts + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.numArtifacts = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Results buildStepOutputs. + * @member {Array.} buildStepOutputs + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.buildStepOutputs = $util.emptyArray; + + /** + * Results artifactTiming. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} artifactTiming + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.artifactTiming = null; + + /** + * Results pythonPackages. + * @member {Array.} pythonPackages + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.pythonPackages = $util.emptyArray; + + /** + * Results mavenArtifacts. + * @member {Array.} mavenArtifacts + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + */ + Results.prototype.mavenArtifacts = $util.emptyArray; + + /** + * Creates a new Results instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {google.devtools.cloudbuild.v1.IResults=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Results} Results instance + */ + Results.create = function create(properties) { + return new Results(properties); + }; + + /** + * Encodes the specified Results message. Does not implicitly {@link google.devtools.cloudbuild.v1.Results.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {google.devtools.cloudbuild.v1.IResults} message Results message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Results.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.images != null && message.images.length) + for (var i = 0; i < message.images.length; ++i) + $root.google.devtools.cloudbuild.v1.BuiltImage.encode(message.images[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.buildStepImages != null && message.buildStepImages.length) + for (var i = 0; i < message.buildStepImages.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.buildStepImages[i]); + if (message.artifactManifest != null && Object.hasOwnProperty.call(message, "artifactManifest")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.artifactManifest); + if (message.numArtifacts != null && Object.hasOwnProperty.call(message, "numArtifacts")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.numArtifacts); + if (message.buildStepOutputs != null && message.buildStepOutputs.length) + for (var i = 0; i < message.buildStepOutputs.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.buildStepOutputs[i]); + if (message.artifactTiming != null && Object.hasOwnProperty.call(message, "artifactTiming")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.artifactTiming, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.pythonPackages != null && message.pythonPackages.length) + for (var i = 0; i < message.pythonPackages.length; ++i) + $root.google.devtools.cloudbuild.v1.UploadedPythonPackage.encode(message.pythonPackages[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.mavenArtifacts != null && message.mavenArtifacts.length) + for (var i = 0; i < message.mavenArtifacts.length; ++i) + $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact.encode(message.mavenArtifacts[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Results message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Results.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {google.devtools.cloudbuild.v1.IResults} message Results message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Results.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Results message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Results} Results + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Results.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Results(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.images && message.images.length)) + message.images = []; + message.images.push($root.google.devtools.cloudbuild.v1.BuiltImage.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.buildStepImages && message.buildStepImages.length)) + message.buildStepImages = []; + message.buildStepImages.push(reader.string()); + break; + } + case 4: { + message.artifactManifest = reader.string(); + break; + } + case 5: { + message.numArtifacts = reader.int64(); + break; + } + case 6: { + if (!(message.buildStepOutputs && message.buildStepOutputs.length)) + message.buildStepOutputs = []; + message.buildStepOutputs.push(reader.bytes()); + break; + } + case 7: { + message.artifactTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.pythonPackages && message.pythonPackages.length)) + message.pythonPackages = []; + message.pythonPackages.push($root.google.devtools.cloudbuild.v1.UploadedPythonPackage.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.mavenArtifacts && message.mavenArtifacts.length)) + message.mavenArtifacts = []; + message.mavenArtifacts.push($root.google.devtools.cloudbuild.v1.UploadedMavenArtifact.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Results message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Results} Results + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Results.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Results message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Results.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.images != null && message.hasOwnProperty("images")) { + if (!Array.isArray(message.images)) + return "images: array expected"; + for (var i = 0; i < message.images.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.BuiltImage.verify(message.images[i]); + if (error) + return "images." + error; + } + } + if (message.buildStepImages != null && message.hasOwnProperty("buildStepImages")) { + if (!Array.isArray(message.buildStepImages)) + return "buildStepImages: array expected"; + for (var i = 0; i < message.buildStepImages.length; ++i) + if (!$util.isString(message.buildStepImages[i])) + return "buildStepImages: string[] expected"; + } + if (message.artifactManifest != null && message.hasOwnProperty("artifactManifest")) + if (!$util.isString(message.artifactManifest)) + return "artifactManifest: string expected"; + if (message.numArtifacts != null && message.hasOwnProperty("numArtifacts")) + if (!$util.isInteger(message.numArtifacts) && !(message.numArtifacts && $util.isInteger(message.numArtifacts.low) && $util.isInteger(message.numArtifacts.high))) + return "numArtifacts: integer|Long expected"; + if (message.buildStepOutputs != null && message.hasOwnProperty("buildStepOutputs")) { + if (!Array.isArray(message.buildStepOutputs)) + return "buildStepOutputs: array expected"; + for (var i = 0; i < message.buildStepOutputs.length; ++i) + if (!(message.buildStepOutputs[i] && typeof message.buildStepOutputs[i].length === "number" || $util.isString(message.buildStepOutputs[i]))) + return "buildStepOutputs: buffer[] expected"; + } + if (message.artifactTiming != null && message.hasOwnProperty("artifactTiming")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.artifactTiming); + if (error) + return "artifactTiming." + error; + } + if (message.pythonPackages != null && message.hasOwnProperty("pythonPackages")) { + if (!Array.isArray(message.pythonPackages)) + return "pythonPackages: array expected"; + for (var i = 0; i < message.pythonPackages.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.UploadedPythonPackage.verify(message.pythonPackages[i]); + if (error) + return "pythonPackages." + error; + } + } + if (message.mavenArtifacts != null && message.hasOwnProperty("mavenArtifacts")) { + if (!Array.isArray(message.mavenArtifacts)) + return "mavenArtifacts: array expected"; + for (var i = 0; i < message.mavenArtifacts.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact.verify(message.mavenArtifacts[i]); + if (error) + return "mavenArtifacts." + error; + } + } + return null; + }; + + /** + * Creates a Results message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Results} Results + */ + Results.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Results) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Results(); + if (object.images) { + if (!Array.isArray(object.images)) + throw TypeError(".google.devtools.cloudbuild.v1.Results.images: array expected"); + message.images = []; + for (var i = 0; i < object.images.length; ++i) { + if (typeof object.images[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Results.images: object expected"); + message.images[i] = $root.google.devtools.cloudbuild.v1.BuiltImage.fromObject(object.images[i]); + } + } + if (object.buildStepImages) { + if (!Array.isArray(object.buildStepImages)) + throw TypeError(".google.devtools.cloudbuild.v1.Results.buildStepImages: array expected"); + message.buildStepImages = []; + for (var i = 0; i < object.buildStepImages.length; ++i) + message.buildStepImages[i] = String(object.buildStepImages[i]); + } + if (object.artifactManifest != null) + message.artifactManifest = String(object.artifactManifest); + if (object.numArtifacts != null) + if ($util.Long) + (message.numArtifacts = $util.Long.fromValue(object.numArtifacts)).unsigned = false; + else if (typeof object.numArtifacts === "string") + message.numArtifacts = parseInt(object.numArtifacts, 10); + else if (typeof object.numArtifacts === "number") + message.numArtifacts = object.numArtifacts; + else if (typeof object.numArtifacts === "object") + message.numArtifacts = new $util.LongBits(object.numArtifacts.low >>> 0, object.numArtifacts.high >>> 0).toNumber(); + if (object.buildStepOutputs) { + if (!Array.isArray(object.buildStepOutputs)) + throw TypeError(".google.devtools.cloudbuild.v1.Results.buildStepOutputs: array expected"); + message.buildStepOutputs = []; + for (var i = 0; i < object.buildStepOutputs.length; ++i) + if (typeof object.buildStepOutputs[i] === "string") + $util.base64.decode(object.buildStepOutputs[i], message.buildStepOutputs[i] = $util.newBuffer($util.base64.length(object.buildStepOutputs[i])), 0); + else if (object.buildStepOutputs[i].length >= 0) + message.buildStepOutputs[i] = object.buildStepOutputs[i]; + } + if (object.artifactTiming != null) { + if (typeof object.artifactTiming !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Results.artifactTiming: object expected"); + message.artifactTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.artifactTiming); + } + if (object.pythonPackages) { + if (!Array.isArray(object.pythonPackages)) + throw TypeError(".google.devtools.cloudbuild.v1.Results.pythonPackages: array expected"); + message.pythonPackages = []; + for (var i = 0; i < object.pythonPackages.length; ++i) { + if (typeof object.pythonPackages[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Results.pythonPackages: object expected"); + message.pythonPackages[i] = $root.google.devtools.cloudbuild.v1.UploadedPythonPackage.fromObject(object.pythonPackages[i]); + } + } + if (object.mavenArtifacts) { + if (!Array.isArray(object.mavenArtifacts)) + throw TypeError(".google.devtools.cloudbuild.v1.Results.mavenArtifacts: array expected"); + message.mavenArtifacts = []; + for (var i = 0; i < object.mavenArtifacts.length; ++i) { + if (typeof object.mavenArtifacts[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Results.mavenArtifacts: object expected"); + message.mavenArtifacts[i] = $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact.fromObject(object.mavenArtifacts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Results message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {google.devtools.cloudbuild.v1.Results} message Results + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Results.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.images = []; + object.buildStepImages = []; + object.buildStepOutputs = []; + object.pythonPackages = []; + object.mavenArtifacts = []; + } + if (options.defaults) { + object.artifactManifest = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.numArtifacts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.numArtifacts = options.longs === String ? "0" : 0; + object.artifactTiming = null; + } + if (message.images && message.images.length) { + object.images = []; + for (var j = 0; j < message.images.length; ++j) + object.images[j] = $root.google.devtools.cloudbuild.v1.BuiltImage.toObject(message.images[j], options); + } + if (message.buildStepImages && message.buildStepImages.length) { + object.buildStepImages = []; + for (var j = 0; j < message.buildStepImages.length; ++j) + object.buildStepImages[j] = message.buildStepImages[j]; + } + if (message.artifactManifest != null && message.hasOwnProperty("artifactManifest")) + object.artifactManifest = message.artifactManifest; + if (message.numArtifacts != null && message.hasOwnProperty("numArtifacts")) + if (typeof message.numArtifacts === "number") + object.numArtifacts = options.longs === String ? String(message.numArtifacts) : message.numArtifacts; + else + object.numArtifacts = options.longs === String ? $util.Long.prototype.toString.call(message.numArtifacts) : options.longs === Number ? new $util.LongBits(message.numArtifacts.low >>> 0, message.numArtifacts.high >>> 0).toNumber() : message.numArtifacts; + if (message.buildStepOutputs && message.buildStepOutputs.length) { + object.buildStepOutputs = []; + for (var j = 0; j < message.buildStepOutputs.length; ++j) + object.buildStepOutputs[j] = options.bytes === String ? $util.base64.encode(message.buildStepOutputs[j], 0, message.buildStepOutputs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.buildStepOutputs[j]) : message.buildStepOutputs[j]; + } + if (message.artifactTiming != null && message.hasOwnProperty("artifactTiming")) + object.artifactTiming = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.artifactTiming, options); + if (message.pythonPackages && message.pythonPackages.length) { + object.pythonPackages = []; + for (var j = 0; j < message.pythonPackages.length; ++j) + object.pythonPackages[j] = $root.google.devtools.cloudbuild.v1.UploadedPythonPackage.toObject(message.pythonPackages[j], options); + } + if (message.mavenArtifacts && message.mavenArtifacts.length) { + object.mavenArtifacts = []; + for (var j = 0; j < message.mavenArtifacts.length; ++j) + object.mavenArtifacts[j] = $root.google.devtools.cloudbuild.v1.UploadedMavenArtifact.toObject(message.mavenArtifacts[j], options); + } + return object; + }; + + /** + * Converts this Results to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Results + * @instance + * @returns {Object.} JSON object + */ + Results.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Results + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Results + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Results.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Results"; + }; + + return Results; + })(); + + v1.ArtifactResult = (function() { + + /** + * Properties of an ArtifactResult. + * @memberof google.devtools.cloudbuild.v1 + * @interface IArtifactResult + * @property {string|null} [location] ArtifactResult location + * @property {Array.|null} [fileHash] ArtifactResult fileHash + */ + + /** + * Constructs a new ArtifactResult. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an ArtifactResult. + * @implements IArtifactResult + * @constructor + * @param {google.devtools.cloudbuild.v1.IArtifactResult=} [properties] Properties to set + */ + function ArtifactResult(properties) { + this.fileHash = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArtifactResult location. + * @member {string} location + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @instance + */ + ArtifactResult.prototype.location = ""; + + /** + * ArtifactResult fileHash. + * @member {Array.} fileHash + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @instance + */ + ArtifactResult.prototype.fileHash = $util.emptyArray; + + /** + * Creates a new ArtifactResult instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {google.devtools.cloudbuild.v1.IArtifactResult=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ArtifactResult} ArtifactResult instance + */ + ArtifactResult.create = function create(properties) { + return new ArtifactResult(properties); + }; + + /** + * Encodes the specified ArtifactResult message. Does not implicitly {@link google.devtools.cloudbuild.v1.ArtifactResult.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {google.devtools.cloudbuild.v1.IArtifactResult} message ArtifactResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArtifactResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.fileHash != null && message.fileHash.length) + for (var i = 0; i < message.fileHash.length; ++i) + $root.google.devtools.cloudbuild.v1.FileHashes.encode(message.fileHash[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArtifactResult message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ArtifactResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {google.devtools.cloudbuild.v1.IArtifactResult} message ArtifactResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArtifactResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArtifactResult message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ArtifactResult} ArtifactResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArtifactResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ArtifactResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + if (!(message.fileHash && message.fileHash.length)) + message.fileHash = []; + message.fileHash.push($root.google.devtools.cloudbuild.v1.FileHashes.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArtifactResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ArtifactResult} ArtifactResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArtifactResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArtifactResult message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArtifactResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.fileHash != null && message.hasOwnProperty("fileHash")) { + if (!Array.isArray(message.fileHash)) + return "fileHash: array expected"; + for (var i = 0; i < message.fileHash.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.FileHashes.verify(message.fileHash[i]); + if (error) + return "fileHash." + error; + } + } + return null; + }; + + /** + * Creates an ArtifactResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ArtifactResult} ArtifactResult + */ + ArtifactResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ArtifactResult) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ArtifactResult(); + if (object.location != null) + message.location = String(object.location); + if (object.fileHash) { + if (!Array.isArray(object.fileHash)) + throw TypeError(".google.devtools.cloudbuild.v1.ArtifactResult.fileHash: array expected"); + message.fileHash = []; + for (var i = 0; i < object.fileHash.length; ++i) { + if (typeof object.fileHash[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ArtifactResult.fileHash: object expected"); + message.fileHash[i] = $root.google.devtools.cloudbuild.v1.FileHashes.fromObject(object.fileHash[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ArtifactResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {google.devtools.cloudbuild.v1.ArtifactResult} message ArtifactResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArtifactResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fileHash = []; + if (options.defaults) + object.location = ""; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.fileHash && message.fileHash.length) { + object.fileHash = []; + for (var j = 0; j < message.fileHash.length; ++j) + object.fileHash[j] = $root.google.devtools.cloudbuild.v1.FileHashes.toObject(message.fileHash[j], options); + } + return object; + }; + + /** + * Converts this ArtifactResult to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @instance + * @returns {Object.} JSON object + */ + ArtifactResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArtifactResult + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ArtifactResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArtifactResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ArtifactResult"; + }; + + return ArtifactResult; + })(); + + v1.Build = (function() { + + /** + * Properties of a Build. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuild + * @property {string|null} [name] Build name + * @property {string|null} [id] Build id + * @property {string|null} [projectId] Build projectId + * @property {google.devtools.cloudbuild.v1.Build.Status|null} [status] Build status + * @property {string|null} [statusDetail] Build statusDetail + * @property {google.devtools.cloudbuild.v1.ISource|null} [source] Build source + * @property {Array.|null} [steps] Build steps + * @property {google.devtools.cloudbuild.v1.IResults|null} [results] Build results + * @property {google.protobuf.ITimestamp|null} [createTime] Build createTime + * @property {google.protobuf.ITimestamp|null} [startTime] Build startTime + * @property {google.protobuf.ITimestamp|null} [finishTime] Build finishTime + * @property {google.protobuf.IDuration|null} [timeout] Build timeout + * @property {Array.|null} [images] Build images + * @property {google.protobuf.IDuration|null} [queueTtl] Build queueTtl + * @property {google.devtools.cloudbuild.v1.IArtifacts|null} [artifacts] Build artifacts + * @property {string|null} [logsBucket] Build logsBucket + * @property {google.devtools.cloudbuild.v1.ISourceProvenance|null} [sourceProvenance] Build sourceProvenance + * @property {string|null} [buildTriggerId] Build buildTriggerId + * @property {google.devtools.cloudbuild.v1.IBuildOptions|null} [options] Build options + * @property {string|null} [logUrl] Build logUrl + * @property {Object.|null} [substitutions] Build substitutions + * @property {Array.|null} [tags] Build tags + * @property {Array.|null} [secrets] Build secrets + * @property {Object.|null} [timing] Build timing + * @property {google.devtools.cloudbuild.v1.IBuildApproval|null} [approval] Build approval + * @property {string|null} [serviceAccount] Build serviceAccount + * @property {google.devtools.cloudbuild.v1.ISecrets|null} [availableSecrets] Build availableSecrets + * @property {Array.|null} [warnings] Build warnings + * @property {google.devtools.cloudbuild.v1.Build.IFailureInfo|null} [failureInfo] Build failureInfo + */ + + /** + * Constructs a new Build. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Build. + * @implements IBuild + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuild=} [properties] Properties to set + */ + function Build(properties) { + this.steps = []; + this.images = []; + this.substitutions = {}; + this.tags = []; + this.secrets = []; + this.timing = {}; + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Build name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.name = ""; + + /** + * Build id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.id = ""; + + /** + * Build projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.projectId = ""; + + /** + * Build status. + * @member {google.devtools.cloudbuild.v1.Build.Status} status + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.status = 0; + + /** + * Build statusDetail. + * @member {string} statusDetail + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.statusDetail = ""; + + /** + * Build source. + * @member {google.devtools.cloudbuild.v1.ISource|null|undefined} source + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.source = null; + + /** + * Build steps. + * @member {Array.} steps + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.steps = $util.emptyArray; + + /** + * Build results. + * @member {google.devtools.cloudbuild.v1.IResults|null|undefined} results + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.results = null; + + /** + * Build createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.createTime = null; + + /** + * Build startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.startTime = null; + + /** + * Build finishTime. + * @member {google.protobuf.ITimestamp|null|undefined} finishTime + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.finishTime = null; + + /** + * Build timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.timeout = null; + + /** + * Build images. + * @member {Array.} images + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.images = $util.emptyArray; + + /** + * Build queueTtl. + * @member {google.protobuf.IDuration|null|undefined} queueTtl + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.queueTtl = null; + + /** + * Build artifacts. + * @member {google.devtools.cloudbuild.v1.IArtifacts|null|undefined} artifacts + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.artifacts = null; + + /** + * Build logsBucket. + * @member {string} logsBucket + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.logsBucket = ""; + + /** + * Build sourceProvenance. + * @member {google.devtools.cloudbuild.v1.ISourceProvenance|null|undefined} sourceProvenance + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.sourceProvenance = null; + + /** + * Build buildTriggerId. + * @member {string} buildTriggerId + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.buildTriggerId = ""; + + /** + * Build options. + * @member {google.devtools.cloudbuild.v1.IBuildOptions|null|undefined} options + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.options = null; + + /** + * Build logUrl. + * @member {string} logUrl + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.logUrl = ""; + + /** + * Build substitutions. + * @member {Object.} substitutions + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.substitutions = $util.emptyObject; + + /** + * Build tags. + * @member {Array.} tags + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.tags = $util.emptyArray; + + /** + * Build secrets. + * @member {Array.} secrets + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.secrets = $util.emptyArray; + + /** + * Build timing. + * @member {Object.} timing + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.timing = $util.emptyObject; + + /** + * Build approval. + * @member {google.devtools.cloudbuild.v1.IBuildApproval|null|undefined} approval + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.approval = null; + + /** + * Build serviceAccount. + * @member {string} serviceAccount + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.serviceAccount = ""; + + /** + * Build availableSecrets. + * @member {google.devtools.cloudbuild.v1.ISecrets|null|undefined} availableSecrets + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.availableSecrets = null; + + /** + * Build warnings. + * @member {Array.} warnings + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.warnings = $util.emptyArray; + + /** + * Build failureInfo. + * @member {google.devtools.cloudbuild.v1.Build.IFailureInfo|null|undefined} failureInfo + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + */ + Build.prototype.failureInfo = null; + + /** + * Creates a new Build instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {google.devtools.cloudbuild.v1.IBuild=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Build} Build instance + */ + Build.create = function create(properties) { + return new Build(properties); + }; + + /** + * Encodes the specified Build message. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {google.devtools.cloudbuild.v1.IBuild} message Build message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Build.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.google.devtools.cloudbuild.v1.Source.encode(message.source, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.finishTime != null && Object.hasOwnProperty.call(message, "finishTime")) + $root.google.protobuf.Timestamp.encode(message.finishTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.results != null && Object.hasOwnProperty.call(message, "results")) + $root.google.devtools.cloudbuild.v1.Results.encode(message.results, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.steps != null && message.steps.length) + for (var i = 0; i < message.steps.length; ++i) + $root.google.devtools.cloudbuild.v1.BuildStep.encode(message.steps[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.images != null && message.images.length) + for (var i = 0; i < message.images.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.images[i]); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.projectId); + if (message.logsBucket != null && Object.hasOwnProperty.call(message, "logsBucket")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.logsBucket); + if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance")) + $root.google.devtools.cloudbuild.v1.SourceProvenance.encode(message.sourceProvenance, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.buildTriggerId != null && Object.hasOwnProperty.call(message, "buildTriggerId")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.buildTriggerId); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.devtools.cloudbuild.v1.BuildOptions.encode(message.options, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.statusDetail); + if (message.logUrl != null && Object.hasOwnProperty.call(message, "logUrl")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.logUrl); + if (message.substitutions != null && Object.hasOwnProperty.call(message, "substitutions")) + for (var keys = Object.keys(message.substitutions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 29, wireType 2 =*/234).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.substitutions[keys[i]]).ldelim(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 31, wireType 2 =*/250).string(message.tags[i]); + if (message.secrets != null && message.secrets.length) + for (var i = 0; i < message.secrets.length; ++i) + $root.google.devtools.cloudbuild.v1.Secret.encode(message.secrets[i], writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.timing != null && Object.hasOwnProperty.call(message, "timing")) + for (var keys = Object.keys(message.timing), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 33, wireType 2 =*/266).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.timing[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.artifacts != null && Object.hasOwnProperty.call(message, "artifacts")) + $root.google.devtools.cloudbuild.v1.Artifacts.encode(message.artifacts, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.queueTtl != null && Object.hasOwnProperty.call(message, "queueTtl")) + $root.google.protobuf.Duration.encode(message.queueTtl, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 42, wireType 2 =*/338).string(message.serviceAccount); + if (message.approval != null && Object.hasOwnProperty.call(message, "approval")) + $root.google.devtools.cloudbuild.v1.BuildApproval.encode(message.approval, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.name); + if (message.availableSecrets != null && Object.hasOwnProperty.call(message, "availableSecrets")) + $root.google.devtools.cloudbuild.v1.Secrets.encode(message.availableSecrets, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.devtools.cloudbuild.v1.Build.Warning.encode(message.warnings[i], writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + if (message.failureInfo != null && Object.hasOwnProperty.call(message, "failureInfo")) + $root.google.devtools.cloudbuild.v1.Build.FailureInfo.encode(message.failureInfo, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Build message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {google.devtools.cloudbuild.v1.IBuild} message Build message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Build.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Build message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Build} Build + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Build.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Build(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 45: { + message.name = reader.string(); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 16: { + message.projectId = reader.string(); + break; + } + case 2: { + message.status = reader.int32(); + break; + } + case 24: { + message.statusDetail = reader.string(); + break; + } + case 3: { + message.source = $root.google.devtools.cloudbuild.v1.Source.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.steps && message.steps.length)) + message.steps = []; + message.steps.push($root.google.devtools.cloudbuild.v1.BuildStep.decode(reader, reader.uint32())); + break; + } + case 10: { + message.results = $root.google.devtools.cloudbuild.v1.Results.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.finishTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.images && message.images.length)) + message.images = []; + message.images.push(reader.string()); + break; + } + case 40: { + message.queueTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 37: { + message.artifacts = $root.google.devtools.cloudbuild.v1.Artifacts.decode(reader, reader.uint32()); + break; + } + case 19: { + message.logsBucket = reader.string(); + break; + } + case 21: { + message.sourceProvenance = $root.google.devtools.cloudbuild.v1.SourceProvenance.decode(reader, reader.uint32()); + break; + } + case 22: { + message.buildTriggerId = reader.string(); + break; + } + case 23: { + message.options = $root.google.devtools.cloudbuild.v1.BuildOptions.decode(reader, reader.uint32()); + break; + } + case 25: { + message.logUrl = reader.string(); + break; + } + case 29: { + if (message.substitutions === $util.emptyObject) + message.substitutions = {}; + 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.substitutions[key] = value; + break; + } + case 31: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 32: { + if (!(message.secrets && message.secrets.length)) + message.secrets = []; + message.secrets.push($root.google.devtools.cloudbuild.v1.Secret.decode(reader, reader.uint32())); + break; + } + case 33: { + if (message.timing === $util.emptyObject) + message.timing = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.timing[key] = value; + break; + } + case 44: { + message.approval = $root.google.devtools.cloudbuild.v1.BuildApproval.decode(reader, reader.uint32()); + break; + } + case 42: { + message.serviceAccount = reader.string(); + break; + } + case 47: { + message.availableSecrets = $root.google.devtools.cloudbuild.v1.Secrets.decode(reader, reader.uint32()); + break; + } + case 49: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.devtools.cloudbuild.v1.Build.Warning.decode(reader, reader.uint32())); + break; + } + case 51: { + message.failureInfo = $root.google.devtools.cloudbuild.v1.Build.FailureInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Build message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Build} Build + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Build.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Build message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Build.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.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 10: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 9: + break; + } + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: string expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.google.devtools.cloudbuild.v1.Source.verify(message.source); + if (error) + return "source." + error; + } + if (message.steps != null && message.hasOwnProperty("steps")) { + if (!Array.isArray(message.steps)) + return "steps: array expected"; + for (var i = 0; i < message.steps.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.BuildStep.verify(message.steps[i]); + if (error) + return "steps." + error; + } + } + if (message.results != null && message.hasOwnProperty("results")) { + var error = $root.google.devtools.cloudbuild.v1.Results.verify(message.results); + if (error) + return "results." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.finishTime != null && message.hasOwnProperty("finishTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.finishTime); + if (error) + return "finishTime." + error; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.images != null && message.hasOwnProperty("images")) { + if (!Array.isArray(message.images)) + return "images: array expected"; + for (var i = 0; i < message.images.length; ++i) + if (!$util.isString(message.images[i])) + return "images: string[] expected"; + } + if (message.queueTtl != null && message.hasOwnProperty("queueTtl")) { + var error = $root.google.protobuf.Duration.verify(message.queueTtl); + if (error) + return "queueTtl." + error; + } + if (message.artifacts != null && message.hasOwnProperty("artifacts")) { + var error = $root.google.devtools.cloudbuild.v1.Artifacts.verify(message.artifacts); + if (error) + return "artifacts." + error; + } + if (message.logsBucket != null && message.hasOwnProperty("logsBucket")) + if (!$util.isString(message.logsBucket)) + return "logsBucket: string expected"; + if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) { + var error = $root.google.devtools.cloudbuild.v1.SourceProvenance.verify(message.sourceProvenance); + if (error) + return "sourceProvenance." + error; + } + if (message.buildTriggerId != null && message.hasOwnProperty("buildTriggerId")) + if (!$util.isString(message.buildTriggerId)) + return "buildTriggerId: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.devtools.cloudbuild.v1.BuildOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.logUrl != null && message.hasOwnProperty("logUrl")) + if (!$util.isString(message.logUrl)) + return "logUrl: string expected"; + if (message.substitutions != null && message.hasOwnProperty("substitutions")) { + if (!$util.isObject(message.substitutions)) + return "substitutions: object expected"; + var key = Object.keys(message.substitutions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.substitutions[key[i]])) + return "substitutions: string{k:string} expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.secrets != null && message.hasOwnProperty("secrets")) { + if (!Array.isArray(message.secrets)) + return "secrets: array expected"; + for (var i = 0; i < message.secrets.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Secret.verify(message.secrets[i]); + if (error) + return "secrets." + error; + } + } + if (message.timing != null && message.hasOwnProperty("timing")) { + if (!$util.isObject(message.timing)) + return "timing: object expected"; + var key = Object.keys(message.timing); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.timing[key[i]]); + if (error) + return "timing." + error; + } + } + if (message.approval != null && message.hasOwnProperty("approval")) { + var error = $root.google.devtools.cloudbuild.v1.BuildApproval.verify(message.approval); + if (error) + return "approval." + error; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.availableSecrets != null && message.hasOwnProperty("availableSecrets")) { + var error = $root.google.devtools.cloudbuild.v1.Secrets.verify(message.availableSecrets); + if (error) + return "availableSecrets." + error; + } + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Build.Warning.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + if (message.failureInfo != null && message.hasOwnProperty("failureInfo")) { + var error = $root.google.devtools.cloudbuild.v1.Build.FailureInfo.verify(message.failureInfo); + if (error) + return "failureInfo." + error; + } + return null; + }; + + /** + * Creates a Build message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Build} Build + */ + Build.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Build) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Build(); + if (object.name != null) + message.name = String(object.name); + if (object.id != null) + message.id = String(object.id); + if (object.projectId != null) + message.projectId = String(object.projectId); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "STATUS_UNKNOWN": + case 0: + message.status = 0; + break; + case "PENDING": + case 10: + message.status = 10; + break; + case "QUEUED": + case 1: + message.status = 1; + break; + case "WORKING": + case 2: + message.status = 2; + break; + case "SUCCESS": + case 3: + message.status = 3; + break; + case "FAILURE": + case 4: + message.status = 4; + break; + case "INTERNAL_ERROR": + case 5: + message.status = 5; + break; + case "TIMEOUT": + case 6: + message.status = 6; + break; + case "CANCELLED": + case 7: + message.status = 7; + break; + case "EXPIRED": + case 9: + message.status = 9; + break; + } + if (object.statusDetail != null) + message.statusDetail = String(object.statusDetail); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.source: object expected"); + message.source = $root.google.devtools.cloudbuild.v1.Source.fromObject(object.source); + } + if (object.steps) { + if (!Array.isArray(object.steps)) + throw TypeError(".google.devtools.cloudbuild.v1.Build.steps: array expected"); + message.steps = []; + for (var i = 0; i < object.steps.length; ++i) { + if (typeof object.steps[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.steps: object expected"); + message.steps[i] = $root.google.devtools.cloudbuild.v1.BuildStep.fromObject(object.steps[i]); + } + } + if (object.results != null) { + if (typeof object.results !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.results: object expected"); + message.results = $root.google.devtools.cloudbuild.v1.Results.fromObject(object.results); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.finishTime != null) { + if (typeof object.finishTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.finishTime: object expected"); + message.finishTime = $root.google.protobuf.Timestamp.fromObject(object.finishTime); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.images) { + if (!Array.isArray(object.images)) + throw TypeError(".google.devtools.cloudbuild.v1.Build.images: array expected"); + message.images = []; + for (var i = 0; i < object.images.length; ++i) + message.images[i] = String(object.images[i]); + } + if (object.queueTtl != null) { + if (typeof object.queueTtl !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.queueTtl: object expected"); + message.queueTtl = $root.google.protobuf.Duration.fromObject(object.queueTtl); + } + if (object.artifacts != null) { + if (typeof object.artifacts !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.artifacts: object expected"); + message.artifacts = $root.google.devtools.cloudbuild.v1.Artifacts.fromObject(object.artifacts); + } + if (object.logsBucket != null) + message.logsBucket = String(object.logsBucket); + if (object.sourceProvenance != null) { + if (typeof object.sourceProvenance !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.sourceProvenance: object expected"); + message.sourceProvenance = $root.google.devtools.cloudbuild.v1.SourceProvenance.fromObject(object.sourceProvenance); + } + if (object.buildTriggerId != null) + message.buildTriggerId = String(object.buildTriggerId); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.options: object expected"); + message.options = $root.google.devtools.cloudbuild.v1.BuildOptions.fromObject(object.options); + } + if (object.logUrl != null) + message.logUrl = String(object.logUrl); + if (object.substitutions) { + if (typeof object.substitutions !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.substitutions: object expected"); + message.substitutions = {}; + for (var keys = Object.keys(object.substitutions), i = 0; i < keys.length; ++i) + message.substitutions[keys[i]] = String(object.substitutions[keys[i]]); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.devtools.cloudbuild.v1.Build.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.secrets) { + if (!Array.isArray(object.secrets)) + throw TypeError(".google.devtools.cloudbuild.v1.Build.secrets: array expected"); + message.secrets = []; + for (var i = 0; i < object.secrets.length; ++i) { + if (typeof object.secrets[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.secrets: object expected"); + message.secrets[i] = $root.google.devtools.cloudbuild.v1.Secret.fromObject(object.secrets[i]); + } + } + if (object.timing) { + if (typeof object.timing !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.timing: object expected"); + message.timing = {}; + for (var keys = Object.keys(object.timing), i = 0; i < keys.length; ++i) { + if (typeof object.timing[keys[i]] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.timing: object expected"); + message.timing[keys[i]] = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.timing[keys[i]]); + } + } + if (object.approval != null) { + if (typeof object.approval !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.approval: object expected"); + message.approval = $root.google.devtools.cloudbuild.v1.BuildApproval.fromObject(object.approval); + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.availableSecrets != null) { + if (typeof object.availableSecrets !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.availableSecrets: object expected"); + message.availableSecrets = $root.google.devtools.cloudbuild.v1.Secrets.fromObject(object.availableSecrets); + } + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.devtools.cloudbuild.v1.Build.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.warnings: object expected"); + message.warnings[i] = $root.google.devtools.cloudbuild.v1.Build.Warning.fromObject(object.warnings[i]); + } + } + if (object.failureInfo != null) { + if (typeof object.failureInfo !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Build.failureInfo: object expected"); + message.failureInfo = $root.google.devtools.cloudbuild.v1.Build.FailureInfo.fromObject(object.failureInfo); + } + return message; + }; + + /** + * Creates a plain object from a Build message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {google.devtools.cloudbuild.v1.Build} message Build + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Build.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.steps = []; + object.images = []; + object.tags = []; + object.secrets = []; + object.warnings = []; + } + if (options.objects || options.defaults) { + object.substitutions = {}; + object.timing = {}; + } + if (options.defaults) { + object.id = ""; + object.status = options.enums === String ? "STATUS_UNKNOWN" : 0; + object.source = null; + object.createTime = null; + object.startTime = null; + object.finishTime = null; + object.results = null; + object.timeout = null; + object.projectId = ""; + object.logsBucket = ""; + object.sourceProvenance = null; + object.buildTriggerId = ""; + object.options = null; + object.statusDetail = ""; + object.logUrl = ""; + object.artifacts = null; + object.queueTtl = null; + object.serviceAccount = ""; + object.approval = null; + object.name = ""; + object.availableSecrets = null; + object.failureInfo = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.google.devtools.cloudbuild.v1.Build.Status[message.status] === undefined ? message.status : $root.google.devtools.cloudbuild.v1.Build.Status[message.status] : message.status; + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.google.devtools.cloudbuild.v1.Source.toObject(message.source, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.finishTime != null && message.hasOwnProperty("finishTime")) + object.finishTime = $root.google.protobuf.Timestamp.toObject(message.finishTime, options); + if (message.results != null && message.hasOwnProperty("results")) + object.results = $root.google.devtools.cloudbuild.v1.Results.toObject(message.results, options); + if (message.steps && message.steps.length) { + object.steps = []; + for (var j = 0; j < message.steps.length; ++j) + object.steps[j] = $root.google.devtools.cloudbuild.v1.BuildStep.toObject(message.steps[j], options); + } + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.images && message.images.length) { + object.images = []; + for (var j = 0; j < message.images.length; ++j) + object.images[j] = message.images[j]; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.logsBucket != null && message.hasOwnProperty("logsBucket")) + object.logsBucket = message.logsBucket; + if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) + object.sourceProvenance = $root.google.devtools.cloudbuild.v1.SourceProvenance.toObject(message.sourceProvenance, options); + if (message.buildTriggerId != null && message.hasOwnProperty("buildTriggerId")) + object.buildTriggerId = message.buildTriggerId; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.devtools.cloudbuild.v1.BuildOptions.toObject(message.options, options); + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + object.statusDetail = message.statusDetail; + if (message.logUrl != null && message.hasOwnProperty("logUrl")) + object.logUrl = message.logUrl; + var keys2; + if (message.substitutions && (keys2 = Object.keys(message.substitutions)).length) { + object.substitutions = {}; + for (var j = 0; j < keys2.length; ++j) + object.substitutions[keys2[j]] = message.substitutions[keys2[j]]; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.secrets && message.secrets.length) { + object.secrets = []; + for (var j = 0; j < message.secrets.length; ++j) + object.secrets[j] = $root.google.devtools.cloudbuild.v1.Secret.toObject(message.secrets[j], options); + } + if (message.timing && (keys2 = Object.keys(message.timing)).length) { + object.timing = {}; + for (var j = 0; j < keys2.length; ++j) + object.timing[keys2[j]] = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.timing[keys2[j]], options); + } + if (message.artifacts != null && message.hasOwnProperty("artifacts")) + object.artifacts = $root.google.devtools.cloudbuild.v1.Artifacts.toObject(message.artifacts, options); + if (message.queueTtl != null && message.hasOwnProperty("queueTtl")) + object.queueTtl = $root.google.protobuf.Duration.toObject(message.queueTtl, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.approval != null && message.hasOwnProperty("approval")) + object.approval = $root.google.devtools.cloudbuild.v1.BuildApproval.toObject(message.approval, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.availableSecrets != null && message.hasOwnProperty("availableSecrets")) + object.availableSecrets = $root.google.devtools.cloudbuild.v1.Secrets.toObject(message.availableSecrets, options); + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.devtools.cloudbuild.v1.Build.Warning.toObject(message.warnings[j], options); + } + if (message.failureInfo != null && message.hasOwnProperty("failureInfo")) + object.failureInfo = $root.google.devtools.cloudbuild.v1.Build.FailureInfo.toObject(message.failureInfo, options); + return object; + }; + + /** + * Converts this Build to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Build + * @instance + * @returns {Object.} JSON object + */ + Build.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Build + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Build + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Build.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Build"; + }; + + Build.Warning = (function() { + + /** + * Properties of a Warning. + * @memberof google.devtools.cloudbuild.v1.Build + * @interface IWarning + * @property {string|null} [text] Warning text + * @property {google.devtools.cloudbuild.v1.Build.Warning.Priority|null} [priority] Warning priority + */ + + /** + * Constructs a new Warning. + * @memberof google.devtools.cloudbuild.v1.Build + * @classdesc Represents a Warning. + * @implements IWarning + * @constructor + * @param {google.devtools.cloudbuild.v1.Build.IWarning=} [properties] Properties to set + */ + function Warning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Warning text. + * @member {string} text + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @instance + */ + Warning.prototype.text = ""; + + /** + * Warning priority. + * @member {google.devtools.cloudbuild.v1.Build.Warning.Priority} priority + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @instance + */ + Warning.prototype.priority = 0; + + /** + * Creates a new Warning instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {google.devtools.cloudbuild.v1.Build.IWarning=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Build.Warning} Warning instance + */ + Warning.create = function create(properties) { + return new Warning(properties); + }; + + /** + * Encodes the specified Warning message. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.Warning.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {google.devtools.cloudbuild.v1.Build.IWarning} message Warning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified Warning message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.Warning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {google.devtools.cloudbuild.v1.Build.IWarning} message Warning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Warning message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Build.Warning} Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Build.Warning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + case 2: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Warning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Build.Warning} Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Warning message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Warning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + switch (message.priority) { + default: + return "priority: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a Warning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Build.Warning} Warning + */ + Warning.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Build.Warning) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Build.Warning(); + if (object.text != null) + message.text = String(object.text); + switch (object.priority) { + default: + if (typeof object.priority === "number") { + message.priority = object.priority; + break; + } + break; + case "PRIORITY_UNSPECIFIED": + case 0: + message.priority = 0; + break; + case "INFO": + case 1: + message.priority = 1; + break; + case "WARNING": + case 2: + message.priority = 2; + break; + case "ALERT": + case 3: + message.priority = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Warning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {google.devtools.cloudbuild.v1.Build.Warning} message Warning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Warning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.priority = options.enums === String ? "PRIORITY_UNSPECIFIED" : 0; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = options.enums === String ? $root.google.devtools.cloudbuild.v1.Build.Warning.Priority[message.priority] === undefined ? message.priority : $root.google.devtools.cloudbuild.v1.Build.Warning.Priority[message.priority] : message.priority; + return object; + }; + + /** + * Converts this Warning to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @instance + * @returns {Object.} JSON object + */ + Warning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Warning + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Build.Warning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Warning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Build.Warning"; + }; + + /** + * Priority enum. + * @name google.devtools.cloudbuild.v1.Build.Warning.Priority + * @enum {number} + * @property {number} PRIORITY_UNSPECIFIED=0 PRIORITY_UNSPECIFIED value + * @property {number} INFO=1 INFO value + * @property {number} WARNING=2 WARNING value + * @property {number} ALERT=3 ALERT value + */ + Warning.Priority = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIORITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "ALERT"] = 3; + return values; + })(); + + return Warning; + })(); + + Build.FailureInfo = (function() { + + /** + * Properties of a FailureInfo. + * @memberof google.devtools.cloudbuild.v1.Build + * @interface IFailureInfo + * @property {google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType|null} [type] FailureInfo type + * @property {string|null} [detail] FailureInfo detail + */ + + /** + * Constructs a new FailureInfo. + * @memberof google.devtools.cloudbuild.v1.Build + * @classdesc Represents a FailureInfo. + * @implements IFailureInfo + * @constructor + * @param {google.devtools.cloudbuild.v1.Build.IFailureInfo=} [properties] Properties to set + */ + function FailureInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FailureInfo type. + * @member {google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType} type + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @instance + */ + FailureInfo.prototype.type = 0; + + /** + * FailureInfo detail. + * @member {string} detail + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @instance + */ + FailureInfo.prototype.detail = ""; + + /** + * Creates a new FailureInfo instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {google.devtools.cloudbuild.v1.Build.IFailureInfo=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Build.FailureInfo} FailureInfo instance + */ + FailureInfo.create = function create(properties) { + return new FailureInfo(properties); + }; + + /** + * Encodes the specified FailureInfo message. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.FailureInfo.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {google.devtools.cloudbuild.v1.Build.IFailureInfo} message FailureInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailureInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.detail); + return writer; + }; + + /** + * Encodes the specified FailureInfo message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Build.FailureInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {google.devtools.cloudbuild.v1.Build.IFailureInfo} message FailureInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FailureInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FailureInfo message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Build.FailureInfo} FailureInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailureInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Build.FailureInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.detail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FailureInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Build.FailureInfo} FailureInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FailureInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FailureInfo message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FailureInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a FailureInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Build.FailureInfo} FailureInfo + */ + FailureInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Build.FailureInfo) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Build.FailureInfo(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "FAILURE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "PUSH_FAILED": + case 1: + message.type = 1; + break; + case "PUSH_IMAGE_NOT_FOUND": + case 2: + message.type = 2; + break; + case "PUSH_NOT_AUTHORIZED": + case 3: + message.type = 3; + break; + case "LOGGING_FAILURE": + case 4: + message.type = 4; + break; + case "USER_BUILD_STEP": + case 5: + message.type = 5; + break; + case "FETCH_SOURCE_FAILED": + case 6: + message.type = 6; + break; + } + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a FailureInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {google.devtools.cloudbuild.v1.Build.FailureInfo} message FailureInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FailureInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "FAILURE_TYPE_UNSPECIFIED" : 0; + object.detail = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType[message.type] === undefined ? message.type : $root.google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType[message.type] : message.type; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + return object; + }; + + /** + * Converts this FailureInfo to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @instance + * @returns {Object.} JSON object + */ + FailureInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FailureInfo + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Build.FailureInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FailureInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Build.FailureInfo"; + }; + + /** + * FailureType enum. + * @name google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType + * @enum {number} + * @property {number} FAILURE_TYPE_UNSPECIFIED=0 FAILURE_TYPE_UNSPECIFIED value + * @property {number} PUSH_FAILED=1 PUSH_FAILED value + * @property {number} PUSH_IMAGE_NOT_FOUND=2 PUSH_IMAGE_NOT_FOUND value + * @property {number} PUSH_NOT_AUTHORIZED=3 PUSH_NOT_AUTHORIZED value + * @property {number} LOGGING_FAILURE=4 LOGGING_FAILURE value + * @property {number} USER_BUILD_STEP=5 USER_BUILD_STEP value + * @property {number} FETCH_SOURCE_FAILED=6 FETCH_SOURCE_FAILED value + */ + FailureInfo.FailureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PUSH_FAILED"] = 1; + values[valuesById[2] = "PUSH_IMAGE_NOT_FOUND"] = 2; + values[valuesById[3] = "PUSH_NOT_AUTHORIZED"] = 3; + values[valuesById[4] = "LOGGING_FAILURE"] = 4; + values[valuesById[5] = "USER_BUILD_STEP"] = 5; + values[valuesById[6] = "FETCH_SOURCE_FAILED"] = 6; + return values; + })(); + + return FailureInfo; + })(); + + /** + * Status enum. + * @name google.devtools.cloudbuild.v1.Build.Status + * @enum {number} + * @property {number} STATUS_UNKNOWN=0 STATUS_UNKNOWN value + * @property {number} PENDING=10 PENDING value + * @property {number} QUEUED=1 QUEUED value + * @property {number} WORKING=2 WORKING value + * @property {number} SUCCESS=3 SUCCESS value + * @property {number} FAILURE=4 FAILURE value + * @property {number} INTERNAL_ERROR=5 INTERNAL_ERROR value + * @property {number} TIMEOUT=6 TIMEOUT value + * @property {number} CANCELLED=7 CANCELLED value + * @property {number} EXPIRED=9 EXPIRED value + */ + Build.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATUS_UNKNOWN"] = 0; + values[valuesById[10] = "PENDING"] = 10; + values[valuesById[1] = "QUEUED"] = 1; + values[valuesById[2] = "WORKING"] = 2; + values[valuesById[3] = "SUCCESS"] = 3; + values[valuesById[4] = "FAILURE"] = 4; + values[valuesById[5] = "INTERNAL_ERROR"] = 5; + values[valuesById[6] = "TIMEOUT"] = 6; + values[valuesById[7] = "CANCELLED"] = 7; + values[valuesById[9] = "EXPIRED"] = 9; + return values; + })(); + + return Build; + })(); + + v1.Artifacts = (function() { + + /** + * Properties of an Artifacts. + * @memberof google.devtools.cloudbuild.v1 + * @interface IArtifacts + * @property {Array.|null} [images] Artifacts images + * @property {google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects|null} [objects] Artifacts objects + * @property {Array.|null} [mavenArtifacts] Artifacts mavenArtifacts + * @property {Array.|null} [pythonPackages] Artifacts pythonPackages + */ + + /** + * Constructs a new Artifacts. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an Artifacts. + * @implements IArtifacts + * @constructor + * @param {google.devtools.cloudbuild.v1.IArtifacts=} [properties] Properties to set + */ + function Artifacts(properties) { + this.images = []; + this.mavenArtifacts = []; + this.pythonPackages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Artifacts images. + * @member {Array.} images + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @instance + */ + Artifacts.prototype.images = $util.emptyArray; + + /** + * Artifacts objects. + * @member {google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects|null|undefined} objects + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @instance + */ + Artifacts.prototype.objects = null; + + /** + * Artifacts mavenArtifacts. + * @member {Array.} mavenArtifacts + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @instance + */ + Artifacts.prototype.mavenArtifacts = $util.emptyArray; + + /** + * Artifacts pythonPackages. + * @member {Array.} pythonPackages + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @instance + */ + Artifacts.prototype.pythonPackages = $util.emptyArray; + + /** + * Creates a new Artifacts instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {google.devtools.cloudbuild.v1.IArtifacts=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Artifacts} Artifacts instance + */ + Artifacts.create = function create(properties) { + return new Artifacts(properties); + }; + + /** + * Encodes the specified Artifacts message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {google.devtools.cloudbuild.v1.IArtifacts} message Artifacts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Artifacts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.images != null && message.images.length) + for (var i = 0; i < message.images.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.images[i]); + if (message.objects != null && Object.hasOwnProperty.call(message, "objects")) + $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.encode(message.objects, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mavenArtifacts != null && message.mavenArtifacts.length) + for (var i = 0; i < message.mavenArtifacts.length; ++i) + $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.encode(message.mavenArtifacts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pythonPackages != null && message.pythonPackages.length) + for (var i = 0; i < message.pythonPackages.length; ++i) + $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage.encode(message.pythonPackages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Artifacts message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {google.devtools.cloudbuild.v1.IArtifacts} message Artifacts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Artifacts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Artifacts message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Artifacts} Artifacts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Artifacts.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Artifacts(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.images && message.images.length)) + message.images = []; + message.images.push(reader.string()); + break; + } + case 2: { + message.objects = $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.mavenArtifacts && message.mavenArtifacts.length)) + message.mavenArtifacts = []; + message.mavenArtifacts.push($root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.pythonPackages && message.pythonPackages.length)) + message.pythonPackages = []; + message.pythonPackages.push($root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Artifacts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Artifacts} Artifacts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Artifacts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Artifacts message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Artifacts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.images != null && message.hasOwnProperty("images")) { + if (!Array.isArray(message.images)) + return "images: array expected"; + for (var i = 0; i < message.images.length; ++i) + if (!$util.isString(message.images[i])) + return "images: string[] expected"; + } + if (message.objects != null && message.hasOwnProperty("objects")) { + var error = $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.verify(message.objects); + if (error) + return "objects." + error; + } + if (message.mavenArtifacts != null && message.hasOwnProperty("mavenArtifacts")) { + if (!Array.isArray(message.mavenArtifacts)) + return "mavenArtifacts: array expected"; + for (var i = 0; i < message.mavenArtifacts.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.verify(message.mavenArtifacts[i]); + if (error) + return "mavenArtifacts." + error; + } + } + if (message.pythonPackages != null && message.hasOwnProperty("pythonPackages")) { + if (!Array.isArray(message.pythonPackages)) + return "pythonPackages: array expected"; + for (var i = 0; i < message.pythonPackages.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage.verify(message.pythonPackages[i]); + if (error) + return "pythonPackages." + error; + } + } + return null; + }; + + /** + * Creates an Artifacts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Artifacts} Artifacts + */ + Artifacts.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Artifacts) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Artifacts(); + if (object.images) { + if (!Array.isArray(object.images)) + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.images: array expected"); + message.images = []; + for (var i = 0; i < object.images.length; ++i) + message.images[i] = String(object.images[i]); + } + if (object.objects != null) { + if (typeof object.objects !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.objects: object expected"); + message.objects = $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.fromObject(object.objects); + } + if (object.mavenArtifacts) { + if (!Array.isArray(object.mavenArtifacts)) + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.mavenArtifacts: array expected"); + message.mavenArtifacts = []; + for (var i = 0; i < object.mavenArtifacts.length; ++i) { + if (typeof object.mavenArtifacts[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.mavenArtifacts: object expected"); + message.mavenArtifacts[i] = $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.fromObject(object.mavenArtifacts[i]); + } + } + if (object.pythonPackages) { + if (!Array.isArray(object.pythonPackages)) + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.pythonPackages: array expected"); + message.pythonPackages = []; + for (var i = 0; i < object.pythonPackages.length; ++i) { + if (typeof object.pythonPackages[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.pythonPackages: object expected"); + message.pythonPackages[i] = $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage.fromObject(object.pythonPackages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Artifacts message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts} message Artifacts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Artifacts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.images = []; + object.mavenArtifacts = []; + object.pythonPackages = []; + } + if (options.defaults) + object.objects = null; + if (message.images && message.images.length) { + object.images = []; + for (var j = 0; j < message.images.length; ++j) + object.images[j] = message.images[j]; + } + if (message.objects != null && message.hasOwnProperty("objects")) + object.objects = $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.toObject(message.objects, options); + if (message.mavenArtifacts && message.mavenArtifacts.length) { + object.mavenArtifacts = []; + for (var j = 0; j < message.mavenArtifacts.length; ++j) + object.mavenArtifacts[j] = $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.toObject(message.mavenArtifacts[j], options); + } + if (message.pythonPackages && message.pythonPackages.length) { + object.pythonPackages = []; + for (var j = 0; j < message.pythonPackages.length; ++j) + object.pythonPackages[j] = $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage.toObject(message.pythonPackages[j], options); + } + return object; + }; + + /** + * Converts this Artifacts to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @instance + * @returns {Object.} JSON object + */ + Artifacts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Artifacts + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Artifacts.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Artifacts"; + }; + + Artifacts.ArtifactObjects = (function() { + + /** + * Properties of an ArtifactObjects. + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @interface IArtifactObjects + * @property {string|null} [location] ArtifactObjects location + * @property {Array.|null} [paths] ArtifactObjects paths + * @property {google.devtools.cloudbuild.v1.ITimeSpan|null} [timing] ArtifactObjects timing + */ + + /** + * Constructs a new ArtifactObjects. + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @classdesc Represents an ArtifactObjects. + * @implements IArtifactObjects + * @constructor + * @param {google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects=} [properties] Properties to set + */ + function ArtifactObjects(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]]; + } + + /** + * ArtifactObjects location. + * @member {string} location + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @instance + */ + ArtifactObjects.prototype.location = ""; + + /** + * ArtifactObjects paths. + * @member {Array.} paths + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @instance + */ + ArtifactObjects.prototype.paths = $util.emptyArray; + + /** + * ArtifactObjects timing. + * @member {google.devtools.cloudbuild.v1.ITimeSpan|null|undefined} timing + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @instance + */ + ArtifactObjects.prototype.timing = null; + + /** + * Creates a new ArtifactObjects instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects} ArtifactObjects instance + */ + ArtifactObjects.create = function create(properties) { + return new ArtifactObjects(properties); + }; + + /** + * Encodes the specified ArtifactObjects message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects} message ArtifactObjects message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArtifactObjects.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paths[i]); + if (message.timing != null && Object.hasOwnProperty.call(message, "timing")) + $root.google.devtools.cloudbuild.v1.TimeSpan.encode(message.timing, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArtifactObjects message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IArtifactObjects} message ArtifactObjects message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArtifactObjects.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArtifactObjects message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects} ArtifactObjects + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArtifactObjects.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + case 3: { + message.timing = $root.google.devtools.cloudbuild.v1.TimeSpan.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArtifactObjects message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects} ArtifactObjects + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArtifactObjects.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArtifactObjects message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArtifactObjects.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string 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"; + } + if (message.timing != null && message.hasOwnProperty("timing")) { + var error = $root.google.devtools.cloudbuild.v1.TimeSpan.verify(message.timing); + if (error) + return "timing." + error; + } + return null; + }; + + /** + * Creates an ArtifactObjects message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects} ArtifactObjects + */ + ArtifactObjects.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects(); + if (object.location != null) + message.location = String(object.location); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + if (object.timing != null) { + if (typeof object.timing !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects.timing: object expected"); + message.timing = $root.google.devtools.cloudbuild.v1.TimeSpan.fromObject(object.timing); + } + return message; + }; + + /** + * Creates a plain object from an ArtifactObjects message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects} message ArtifactObjects + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArtifactObjects.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (options.defaults) { + object.location = ""; + object.timing = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + if (message.timing != null && message.hasOwnProperty("timing")) + object.timing = $root.google.devtools.cloudbuild.v1.TimeSpan.toObject(message.timing, options); + return object; + }; + + /** + * Converts this ArtifactObjects to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @instance + * @returns {Object.} JSON object + */ + ArtifactObjects.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArtifactObjects + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArtifactObjects.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects"; + }; + + return ArtifactObjects; + })(); + + Artifacts.MavenArtifact = (function() { + + /** + * Properties of a MavenArtifact. + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @interface IMavenArtifact + * @property {string|null} [repository] MavenArtifact repository + * @property {string|null} [path] MavenArtifact path + * @property {string|null} [artifactId] MavenArtifact artifactId + * @property {string|null} [groupId] MavenArtifact groupId + * @property {string|null} [version] MavenArtifact version + */ + + /** + * Constructs a new MavenArtifact. + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @classdesc Represents a MavenArtifact. + * @implements IMavenArtifact + * @constructor + * @param {google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact=} [properties] Properties to set + */ + function MavenArtifact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MavenArtifact repository. + * @member {string} repository + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @instance + */ + MavenArtifact.prototype.repository = ""; + + /** + * MavenArtifact path. + * @member {string} path + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @instance + */ + MavenArtifact.prototype.path = ""; + + /** + * MavenArtifact artifactId. + * @member {string} artifactId + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @instance + */ + MavenArtifact.prototype.artifactId = ""; + + /** + * MavenArtifact groupId. + * @member {string} groupId + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @instance + */ + MavenArtifact.prototype.groupId = ""; + + /** + * MavenArtifact version. + * @member {string} version + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @instance + */ + MavenArtifact.prototype.version = ""; + + /** + * Creates a new MavenArtifact instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Artifacts.MavenArtifact} MavenArtifact instance + */ + MavenArtifact.create = function create(properties) { + return new MavenArtifact(properties); + }; + + /** + * Encodes the specified MavenArtifact message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact} message MavenArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MavenArtifact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.repository != null && Object.hasOwnProperty.call(message, "repository")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.repository); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.artifactId != null && Object.hasOwnProperty.call(message, "artifactId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.artifactId); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.groupId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.version); + return writer; + }; + + /** + * Encodes the specified MavenArtifact message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.MavenArtifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IMavenArtifact} message MavenArtifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MavenArtifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MavenArtifact message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Artifacts.MavenArtifact} MavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MavenArtifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.repository = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + case 3: { + message.artifactId = reader.string(); + break; + } + case 4: { + message.groupId = reader.string(); + break; + } + case 5: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MavenArtifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Artifacts.MavenArtifact} MavenArtifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MavenArtifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MavenArtifact message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MavenArtifact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.repository != null && message.hasOwnProperty("repository")) + if (!$util.isString(message.repository)) + return "repository: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.artifactId != null && message.hasOwnProperty("artifactId")) + if (!$util.isString(message.artifactId)) + return "artifactId: string expected"; + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a MavenArtifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Artifacts.MavenArtifact} MavenArtifact + */ + MavenArtifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Artifacts.MavenArtifact(); + if (object.repository != null) + message.repository = String(object.repository); + if (object.path != null) + message.path = String(object.path); + if (object.artifactId != null) + message.artifactId = String(object.artifactId); + if (object.groupId != null) + message.groupId = String(object.groupId); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a MavenArtifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.MavenArtifact} message MavenArtifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MavenArtifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.repository = ""; + object.path = ""; + object.artifactId = ""; + object.groupId = ""; + object.version = ""; + } + if (message.repository != null && message.hasOwnProperty("repository")) + object.repository = message.repository; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.artifactId != null && message.hasOwnProperty("artifactId")) + object.artifactId = message.artifactId; + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this MavenArtifact to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @instance + * @returns {Object.} JSON object + */ + MavenArtifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MavenArtifact + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Artifacts.MavenArtifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MavenArtifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Artifacts.MavenArtifact"; + }; + + return MavenArtifact; + })(); + + Artifacts.PythonPackage = (function() { + + /** + * Properties of a PythonPackage. + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @interface IPythonPackage + * @property {string|null} [repository] PythonPackage repository + * @property {Array.|null} [paths] PythonPackage paths + */ + + /** + * Constructs a new PythonPackage. + * @memberof google.devtools.cloudbuild.v1.Artifacts + * @classdesc Represents a PythonPackage. + * @implements IPythonPackage + * @constructor + * @param {google.devtools.cloudbuild.v1.Artifacts.IPythonPackage=} [properties] Properties to set + */ + function PythonPackage(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]]; + } + + /** + * PythonPackage repository. + * @member {string} repository + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @instance + */ + PythonPackage.prototype.repository = ""; + + /** + * PythonPackage paths. + * @member {Array.} paths + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @instance + */ + PythonPackage.prototype.paths = $util.emptyArray; + + /** + * Creates a new PythonPackage instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IPythonPackage=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Artifacts.PythonPackage} PythonPackage instance + */ + PythonPackage.create = function create(properties) { + return new PythonPackage(properties); + }; + + /** + * Encodes the specified PythonPackage message. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.PythonPackage.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IPythonPackage} message PythonPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.repository != null && Object.hasOwnProperty.call(message, "repository")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.repository); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified PythonPackage message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Artifacts.PythonPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.IPythonPackage} message PythonPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonPackage message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Artifacts.PythonPackage} PythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonPackage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.repository = reader.string(); + break; + } + case 2: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Artifacts.PythonPackage} PythonPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonPackage message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.repository != null && message.hasOwnProperty("repository")) + if (!$util.isString(message.repository)) + return "repository: string 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 PythonPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Artifacts.PythonPackage} PythonPackage + */ + PythonPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Artifacts.PythonPackage(); + if (object.repository != null) + message.repository = String(object.repository); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.devtools.cloudbuild.v1.Artifacts.PythonPackage.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 PythonPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {google.devtools.cloudbuild.v1.Artifacts.PythonPackage} message PythonPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (options.defaults) + object.repository = ""; + if (message.repository != null && message.hasOwnProperty("repository")) + object.repository = message.repository; + 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 PythonPackage to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @instance + * @returns {Object.} JSON object + */ + PythonPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonPackage + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Artifacts.PythonPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Artifacts.PythonPackage"; + }; + + return PythonPackage; + })(); + + return Artifacts; + })(); + + v1.TimeSpan = (function() { + + /** + * Properties of a TimeSpan. + * @memberof google.devtools.cloudbuild.v1 + * @interface ITimeSpan + * @property {google.protobuf.ITimestamp|null} [startTime] TimeSpan startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeSpan endTime + */ + + /** + * Constructs a new TimeSpan. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a TimeSpan. + * @implements ITimeSpan + * @constructor + * @param {google.devtools.cloudbuild.v1.ITimeSpan=} [properties] Properties to set + */ + function TimeSpan(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeSpan startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @instance + */ + TimeSpan.prototype.startTime = null; + + /** + * TimeSpan endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @instance + */ + TimeSpan.prototype.endTime = null; + + /** + * Creates a new TimeSpan instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {google.devtools.cloudbuild.v1.ITimeSpan=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.TimeSpan} TimeSpan instance + */ + TimeSpan.create = function create(properties) { + return new TimeSpan(properties); + }; + + /** + * Encodes the specified TimeSpan message. Does not implicitly {@link google.devtools.cloudbuild.v1.TimeSpan.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {google.devtools.cloudbuild.v1.ITimeSpan} message TimeSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSpan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSpan message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.TimeSpan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {google.devtools.cloudbuild.v1.ITimeSpan} message TimeSpan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSpan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSpan message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.TimeSpan} TimeSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSpan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.TimeSpan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSpan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.TimeSpan} TimeSpan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSpan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSpan message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSpan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeSpan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.TimeSpan} TimeSpan + */ + TimeSpan.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.TimeSpan) + return object; + var message = new $root.google.devtools.cloudbuild.v1.TimeSpan(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.TimeSpan.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.TimeSpan.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeSpan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {google.devtools.cloudbuild.v1.TimeSpan} message TimeSpan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSpan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeSpan to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @instance + * @returns {Object.} JSON object + */ + TimeSpan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSpan + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.TimeSpan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSpan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.TimeSpan"; + }; + + return TimeSpan; + })(); + + v1.BuildOperationMetadata = (function() { + + /** + * Properties of a BuildOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuildOperationMetadata + * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] BuildOperationMetadata build + */ + + /** + * Constructs a new BuildOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuildOperationMetadata. + * @implements IBuildOperationMetadata + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuildOperationMetadata=} [properties] Properties to set + */ + function BuildOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildOperationMetadata build. + * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @instance + */ + BuildOperationMetadata.prototype.build = null; + + /** + * Creates a new BuildOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildOperationMetadata} BuildOperationMetadata instance + */ + BuildOperationMetadata.create = function create(properties) { + return new BuildOperationMetadata(properties); + }; + + /** + * Encodes the specified BuildOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOperationMetadata} message BuildOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + $root.google.devtools.cloudbuild.v1.Build.encode(message.build, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BuildOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOperationMetadata} message BuildOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildOperationMetadata} BuildOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildOperationMetadata} BuildOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildOperationMetadata message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.build != null && message.hasOwnProperty("build")) { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); + if (error) + return "build." + error; + } + return null; + }; + + /** + * Creates a BuildOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildOperationMetadata} BuildOperationMetadata + */ + BuildOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildOperationMetadata) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildOperationMetadata(); + if (object.build != null) { + if (typeof object.build !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildOperationMetadata.build: object expected"); + message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); + } + return message; + }; + + /** + * Creates a plain object from a BuildOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.BuildOperationMetadata} message BuildOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.build = null; + if (message.build != null && message.hasOwnProperty("build")) + object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); + return object; + }; + + /** + * Converts this BuildOperationMetadata to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BuildOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildOperationMetadata + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuildOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuildOperationMetadata"; + }; + + return BuildOperationMetadata; + })(); + + v1.SourceProvenance = (function() { + + /** + * Properties of a SourceProvenance. + * @memberof google.devtools.cloudbuild.v1 + * @interface ISourceProvenance + * @property {google.devtools.cloudbuild.v1.IStorageSource|null} [resolvedStorageSource] SourceProvenance resolvedStorageSource + * @property {google.devtools.cloudbuild.v1.IRepoSource|null} [resolvedRepoSource] SourceProvenance resolvedRepoSource + * @property {google.devtools.cloudbuild.v1.IStorageSourceManifest|null} [resolvedStorageSourceManifest] SourceProvenance resolvedStorageSourceManifest + * @property {Object.|null} [fileHashes] SourceProvenance fileHashes + */ + + /** + * Constructs a new SourceProvenance. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a SourceProvenance. + * @implements ISourceProvenance + * @constructor + * @param {google.devtools.cloudbuild.v1.ISourceProvenance=} [properties] Properties to set + */ + function SourceProvenance(properties) { + this.fileHashes = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceProvenance resolvedStorageSource. + * @member {google.devtools.cloudbuild.v1.IStorageSource|null|undefined} resolvedStorageSource + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @instance + */ + SourceProvenance.prototype.resolvedStorageSource = null; + + /** + * SourceProvenance resolvedRepoSource. + * @member {google.devtools.cloudbuild.v1.IRepoSource|null|undefined} resolvedRepoSource + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @instance + */ + SourceProvenance.prototype.resolvedRepoSource = null; + + /** + * SourceProvenance resolvedStorageSourceManifest. + * @member {google.devtools.cloudbuild.v1.IStorageSourceManifest|null|undefined} resolvedStorageSourceManifest + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @instance + */ + SourceProvenance.prototype.resolvedStorageSourceManifest = null; + + /** + * SourceProvenance fileHashes. + * @member {Object.} fileHashes + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @instance + */ + SourceProvenance.prototype.fileHashes = $util.emptyObject; + + /** + * Creates a new SourceProvenance instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {google.devtools.cloudbuild.v1.ISourceProvenance=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.SourceProvenance} SourceProvenance instance + */ + SourceProvenance.create = function create(properties) { + return new SourceProvenance(properties); + }; + + /** + * Encodes the specified SourceProvenance message. Does not implicitly {@link google.devtools.cloudbuild.v1.SourceProvenance.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {google.devtools.cloudbuild.v1.ISourceProvenance} message SourceProvenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceProvenance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resolvedStorageSource != null && Object.hasOwnProperty.call(message, "resolvedStorageSource")) + $root.google.devtools.cloudbuild.v1.StorageSource.encode(message.resolvedStorageSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fileHashes != null && Object.hasOwnProperty.call(message, "fileHashes")) + for (var keys = Object.keys(message.fileHashes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.devtools.cloudbuild.v1.FileHashes.encode(message.fileHashes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.resolvedRepoSource != null && Object.hasOwnProperty.call(message, "resolvedRepoSource")) + $root.google.devtools.cloudbuild.v1.RepoSource.encode(message.resolvedRepoSource, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.resolvedStorageSourceManifest != null && Object.hasOwnProperty.call(message, "resolvedStorageSourceManifest")) + $root.google.devtools.cloudbuild.v1.StorageSourceManifest.encode(message.resolvedStorageSourceManifest, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceProvenance message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.SourceProvenance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {google.devtools.cloudbuild.v1.ISourceProvenance} message SourceProvenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceProvenance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceProvenance message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.SourceProvenance} SourceProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceProvenance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.SourceProvenance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.resolvedStorageSource = $root.google.devtools.cloudbuild.v1.StorageSource.decode(reader, reader.uint32()); + break; + } + case 6: { + message.resolvedRepoSource = $root.google.devtools.cloudbuild.v1.RepoSource.decode(reader, reader.uint32()); + break; + } + case 9: { + message.resolvedStorageSourceManifest = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.fileHashes === $util.emptyObject) + message.fileHashes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.devtools.cloudbuild.v1.FileHashes.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fileHashes[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceProvenance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.SourceProvenance} SourceProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceProvenance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceProvenance message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceProvenance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resolvedStorageSource != null && message.hasOwnProperty("resolvedStorageSource")) { + var error = $root.google.devtools.cloudbuild.v1.StorageSource.verify(message.resolvedStorageSource); + if (error) + return "resolvedStorageSource." + error; + } + if (message.resolvedRepoSource != null && message.hasOwnProperty("resolvedRepoSource")) { + var error = $root.google.devtools.cloudbuild.v1.RepoSource.verify(message.resolvedRepoSource); + if (error) + return "resolvedRepoSource." + error; + } + if (message.resolvedStorageSourceManifest != null && message.hasOwnProperty("resolvedStorageSourceManifest")) { + var error = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.verify(message.resolvedStorageSourceManifest); + if (error) + return "resolvedStorageSourceManifest." + error; + } + if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) { + if (!$util.isObject(message.fileHashes)) + return "fileHashes: object expected"; + var key = Object.keys(message.fileHashes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.FileHashes.verify(message.fileHashes[key[i]]); + if (error) + return "fileHashes." + error; + } + } + return null; + }; + + /** + * Creates a SourceProvenance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.SourceProvenance} SourceProvenance + */ + SourceProvenance.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.SourceProvenance) + return object; + var message = new $root.google.devtools.cloudbuild.v1.SourceProvenance(); + if (object.resolvedStorageSource != null) { + if (typeof object.resolvedStorageSource !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.SourceProvenance.resolvedStorageSource: object expected"); + message.resolvedStorageSource = $root.google.devtools.cloudbuild.v1.StorageSource.fromObject(object.resolvedStorageSource); + } + if (object.resolvedRepoSource != null) { + if (typeof object.resolvedRepoSource !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.SourceProvenance.resolvedRepoSource: object expected"); + message.resolvedRepoSource = $root.google.devtools.cloudbuild.v1.RepoSource.fromObject(object.resolvedRepoSource); + } + if (object.resolvedStorageSourceManifest != null) { + if (typeof object.resolvedStorageSourceManifest !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.SourceProvenance.resolvedStorageSourceManifest: object expected"); + message.resolvedStorageSourceManifest = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.fromObject(object.resolvedStorageSourceManifest); + } + if (object.fileHashes) { + if (typeof object.fileHashes !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.SourceProvenance.fileHashes: object expected"); + message.fileHashes = {}; + for (var keys = Object.keys(object.fileHashes), i = 0; i < keys.length; ++i) { + if (typeof object.fileHashes[keys[i]] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.SourceProvenance.fileHashes: object expected"); + message.fileHashes[keys[i]] = $root.google.devtools.cloudbuild.v1.FileHashes.fromObject(object.fileHashes[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceProvenance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {google.devtools.cloudbuild.v1.SourceProvenance} message SourceProvenance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceProvenance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fileHashes = {}; + if (options.defaults) { + object.resolvedStorageSource = null; + object.resolvedRepoSource = null; + object.resolvedStorageSourceManifest = null; + } + if (message.resolvedStorageSource != null && message.hasOwnProperty("resolvedStorageSource")) + object.resolvedStorageSource = $root.google.devtools.cloudbuild.v1.StorageSource.toObject(message.resolvedStorageSource, options); + var keys2; + if (message.fileHashes && (keys2 = Object.keys(message.fileHashes)).length) { + object.fileHashes = {}; + for (var j = 0; j < keys2.length; ++j) + object.fileHashes[keys2[j]] = $root.google.devtools.cloudbuild.v1.FileHashes.toObject(message.fileHashes[keys2[j]], options); + } + if (message.resolvedRepoSource != null && message.hasOwnProperty("resolvedRepoSource")) + object.resolvedRepoSource = $root.google.devtools.cloudbuild.v1.RepoSource.toObject(message.resolvedRepoSource, options); + if (message.resolvedStorageSourceManifest != null && message.hasOwnProperty("resolvedStorageSourceManifest")) + object.resolvedStorageSourceManifest = $root.google.devtools.cloudbuild.v1.StorageSourceManifest.toObject(message.resolvedStorageSourceManifest, options); + return object; + }; + + /** + * Converts this SourceProvenance to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @instance + * @returns {Object.} JSON object + */ + SourceProvenance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceProvenance + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.SourceProvenance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceProvenance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.SourceProvenance"; + }; + + return SourceProvenance; + })(); + + v1.FileHashes = (function() { + + /** + * Properties of a FileHashes. + * @memberof google.devtools.cloudbuild.v1 + * @interface IFileHashes + * @property {Array.|null} [fileHash] FileHashes fileHash + */ + + /** + * Constructs a new FileHashes. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a FileHashes. + * @implements IFileHashes + * @constructor + * @param {google.devtools.cloudbuild.v1.IFileHashes=} [properties] Properties to set + */ + function FileHashes(properties) { + this.fileHash = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileHashes fileHash. + * @member {Array.} fileHash + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @instance + */ + FileHashes.prototype.fileHash = $util.emptyArray; + + /** + * Creates a new FileHashes instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {google.devtools.cloudbuild.v1.IFileHashes=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.FileHashes} FileHashes instance + */ + FileHashes.create = function create(properties) { + return new FileHashes(properties); + }; + + /** + * Encodes the specified FileHashes message. Does not implicitly {@link google.devtools.cloudbuild.v1.FileHashes.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {google.devtools.cloudbuild.v1.IFileHashes} message FileHashes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileHashes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileHash != null && message.fileHash.length) + for (var i = 0; i < message.fileHash.length; ++i) + $root.google.devtools.cloudbuild.v1.Hash.encode(message.fileHash[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileHashes message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.FileHashes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {google.devtools.cloudbuild.v1.IFileHashes} message FileHashes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileHashes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileHashes message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.FileHashes} FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileHashes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.FileHashes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fileHash && message.fileHash.length)) + message.fileHash = []; + message.fileHash.push($root.google.devtools.cloudbuild.v1.Hash.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileHashes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.FileHashes} FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileHashes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileHashes message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileHashes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileHash != null && message.hasOwnProperty("fileHash")) { + if (!Array.isArray(message.fileHash)) + return "fileHash: array expected"; + for (var i = 0; i < message.fileHash.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Hash.verify(message.fileHash[i]); + if (error) + return "fileHash." + error; + } + } + return null; + }; + + /** + * Creates a FileHashes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.FileHashes} FileHashes + */ + FileHashes.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.FileHashes) + return object; + var message = new $root.google.devtools.cloudbuild.v1.FileHashes(); + if (object.fileHash) { + if (!Array.isArray(object.fileHash)) + throw TypeError(".google.devtools.cloudbuild.v1.FileHashes.fileHash: array expected"); + message.fileHash = []; + for (var i = 0; i < object.fileHash.length; ++i) { + if (typeof object.fileHash[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.FileHashes.fileHash: object expected"); + message.fileHash[i] = $root.google.devtools.cloudbuild.v1.Hash.fromObject(object.fileHash[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileHashes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {google.devtools.cloudbuild.v1.FileHashes} message FileHashes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileHashes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fileHash = []; + if (message.fileHash && message.fileHash.length) { + object.fileHash = []; + for (var j = 0; j < message.fileHash.length; ++j) + object.fileHash[j] = $root.google.devtools.cloudbuild.v1.Hash.toObject(message.fileHash[j], options); + } + return object; + }; + + /** + * Converts this FileHashes to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @instance + * @returns {Object.} JSON object + */ + FileHashes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileHashes + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.FileHashes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileHashes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.FileHashes"; + }; + + return FileHashes; + })(); + + v1.Hash = (function() { + + /** + * Properties of a Hash. + * @memberof google.devtools.cloudbuild.v1 + * @interface IHash + * @property {google.devtools.cloudbuild.v1.Hash.HashType|null} [type] Hash type + * @property {Uint8Array|null} [value] Hash value + */ + + /** + * Constructs a new Hash. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Hash. + * @implements IHash + * @constructor + * @param {google.devtools.cloudbuild.v1.IHash=} [properties] Properties to set + */ + function Hash(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hash type. + * @member {google.devtools.cloudbuild.v1.Hash.HashType} type + * @memberof google.devtools.cloudbuild.v1.Hash + * @instance + */ + Hash.prototype.type = 0; + + /** + * Hash value. + * @member {Uint8Array} value + * @memberof google.devtools.cloudbuild.v1.Hash + * @instance + */ + Hash.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Hash instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {google.devtools.cloudbuild.v1.IHash=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Hash} Hash instance + */ + Hash.create = function create(properties) { + return new Hash(properties); + }; + + /** + * Encodes the specified Hash message. Does not implicitly {@link google.devtools.cloudbuild.v1.Hash.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {google.devtools.cloudbuild.v1.IHash} message Hash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hash.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Hash message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Hash.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {google.devtools.cloudbuild.v1.IHash} message Hash message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hash.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hash message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Hash} Hash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hash.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Hash(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hash message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Hash} Hash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hash.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hash message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hash.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a Hash message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Hash} Hash + */ + Hash.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Hash) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Hash(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "NONE": + case 0: + message.type = 0; + break; + case "SHA256": + case 1: + message.type = 1; + break; + case "MD5": + case 2: + message.type = 2; + break; + } + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a Hash message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {google.devtools.cloudbuild.v1.Hash} message Hash + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hash.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "NONE" : 0; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.devtools.cloudbuild.v1.Hash.HashType[message.type] === undefined ? message.type : $root.google.devtools.cloudbuild.v1.Hash.HashType[message.type] : message.type; + 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 Hash to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Hash + * @instance + * @returns {Object.} JSON object + */ + Hash.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Hash + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Hash + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hash.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Hash"; + }; + + /** + * HashType enum. + * @name google.devtools.cloudbuild.v1.Hash.HashType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SHA256=1 SHA256 value + * @property {number} MD5=2 MD5 value + */ + Hash.HashType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SHA256"] = 1; + values[valuesById[2] = "MD5"] = 2; + return values; + })(); + + return Hash; + })(); + + v1.Secrets = (function() { + + /** + * Properties of a Secrets. + * @memberof google.devtools.cloudbuild.v1 + * @interface ISecrets + * @property {Array.|null} [secretManager] Secrets secretManager + * @property {Array.|null} [inline] Secrets inline + */ + + /** + * Constructs a new Secrets. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Secrets. + * @implements ISecrets + * @constructor + * @param {google.devtools.cloudbuild.v1.ISecrets=} [properties] Properties to set + */ + function Secrets(properties) { + this.secretManager = []; + this.inline = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Secrets secretManager. + * @member {Array.} secretManager + * @memberof google.devtools.cloudbuild.v1.Secrets + * @instance + */ + Secrets.prototype.secretManager = $util.emptyArray; + + /** + * Secrets inline. + * @member {Array.} inline + * @memberof google.devtools.cloudbuild.v1.Secrets + * @instance + */ + Secrets.prototype.inline = $util.emptyArray; + + /** + * Creates a new Secrets instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {google.devtools.cloudbuild.v1.ISecrets=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets instance + */ + Secrets.create = function create(properties) { + return new Secrets(properties); + }; + + /** + * Encodes the specified Secrets message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {google.devtools.cloudbuild.v1.ISecrets} message Secrets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secrets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secretManager != null && message.secretManager.length) + for (var i = 0; i < message.secretManager.length; ++i) + $root.google.devtools.cloudbuild.v1.SecretManagerSecret.encode(message.secretManager[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.inline != null && message.inline.length) + for (var i = 0; i < message.inline.length; ++i) + $root.google.devtools.cloudbuild.v1.InlineSecret.encode(message.inline[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Secrets message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secrets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {google.devtools.cloudbuild.v1.ISecrets} message Secrets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secrets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Secrets message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secrets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Secrets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.secretManager && message.secretManager.length)) + message.secretManager = []; + message.secretManager.push($root.google.devtools.cloudbuild.v1.SecretManagerSecret.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.inline && message.inline.length)) + message.inline = []; + message.inline.push($root.google.devtools.cloudbuild.v1.InlineSecret.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Secrets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secrets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Secrets message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Secrets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.secretManager != null && message.hasOwnProperty("secretManager")) { + if (!Array.isArray(message.secretManager)) + return "secretManager: array expected"; + for (var i = 0; i < message.secretManager.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.SecretManagerSecret.verify(message.secretManager[i]); + if (error) + return "secretManager." + error; + } + } + if (message.inline != null && message.hasOwnProperty("inline")) { + if (!Array.isArray(message.inline)) + return "inline: array expected"; + for (var i = 0; i < message.inline.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.InlineSecret.verify(message.inline[i]); + if (error) + return "inline." + error; + } + } + return null; + }; + + /** + * Creates a Secrets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Secrets} Secrets + */ + Secrets.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Secrets) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Secrets(); + if (object.secretManager) { + if (!Array.isArray(object.secretManager)) + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.secretManager: array expected"); + message.secretManager = []; + for (var i = 0; i < object.secretManager.length; ++i) { + if (typeof object.secretManager[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.secretManager: object expected"); + message.secretManager[i] = $root.google.devtools.cloudbuild.v1.SecretManagerSecret.fromObject(object.secretManager[i]); + } + } + if (object.inline) { + if (!Array.isArray(object.inline)) + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.inline: array expected"); + message.inline = []; + for (var i = 0; i < object.inline.length; ++i) { + if (typeof object.inline[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Secrets.inline: object expected"); + message.inline[i] = $root.google.devtools.cloudbuild.v1.InlineSecret.fromObject(object.inline[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Secrets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {google.devtools.cloudbuild.v1.Secrets} message Secrets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Secrets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.secretManager = []; + object.inline = []; + } + if (message.secretManager && message.secretManager.length) { + object.secretManager = []; + for (var j = 0; j < message.secretManager.length; ++j) + object.secretManager[j] = $root.google.devtools.cloudbuild.v1.SecretManagerSecret.toObject(message.secretManager[j], options); + } + if (message.inline && message.inline.length) { + object.inline = []; + for (var j = 0; j < message.inline.length; ++j) + object.inline[j] = $root.google.devtools.cloudbuild.v1.InlineSecret.toObject(message.inline[j], options); + } + return object; + }; + + /** + * Converts this Secrets to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Secrets + * @instance + * @returns {Object.} JSON object + */ + Secrets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Secrets + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Secrets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Secrets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Secrets"; + }; + + return Secrets; + })(); + + v1.InlineSecret = (function() { + + /** + * Properties of an InlineSecret. + * @memberof google.devtools.cloudbuild.v1 + * @interface IInlineSecret + * @property {string|null} [kmsKeyName] InlineSecret kmsKeyName + * @property {Object.|null} [envMap] InlineSecret envMap + */ + + /** + * Constructs a new InlineSecret. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an InlineSecret. + * @implements IInlineSecret + * @constructor + * @param {google.devtools.cloudbuild.v1.IInlineSecret=} [properties] Properties to set + */ + function InlineSecret(properties) { + this.envMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineSecret kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @instance + */ + InlineSecret.prototype.kmsKeyName = ""; + + /** + * InlineSecret envMap. + * @member {Object.} envMap + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @instance + */ + InlineSecret.prototype.envMap = $util.emptyObject; + + /** + * Creates a new InlineSecret instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {google.devtools.cloudbuild.v1.IInlineSecret=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret instance + */ + InlineSecret.create = function create(properties) { + return new InlineSecret(properties); + }; + + /** + * Encodes the specified InlineSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {google.devtools.cloudbuild.v1.IInlineSecret} message InlineSecret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSecret.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.envMap != null && Object.hasOwnProperty.call(message, "envMap")) + for (var keys = Object.keys(message.envMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.envMap[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InlineSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.InlineSecret.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {google.devtools.cloudbuild.v1.IInlineSecret} message InlineSecret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineSecret.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineSecret message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSecret.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.InlineSecret(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + case 2: { + if (message.envMap === $util.emptyObject) + message.envMap = {}; + 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.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.envMap[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineSecret message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineSecret.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineSecret message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineSecret.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.envMap != null && message.hasOwnProperty("envMap")) { + if (!$util.isObject(message.envMap)) + return "envMap: object expected"; + var key = Object.keys(message.envMap); + for (var i = 0; i < key.length; ++i) + if (!(message.envMap[key[i]] && typeof message.envMap[key[i]].length === "number" || $util.isString(message.envMap[key[i]]))) + return "envMap: buffer{k:string} expected"; + } + return null; + }; + + /** + * Creates an InlineSecret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.InlineSecret} InlineSecret + */ + InlineSecret.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.InlineSecret) + return object; + var message = new $root.google.devtools.cloudbuild.v1.InlineSecret(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.envMap) { + if (typeof object.envMap !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.InlineSecret.envMap: object expected"); + message.envMap = {}; + for (var keys = Object.keys(object.envMap), i = 0; i < keys.length; ++i) + if (typeof object.envMap[keys[i]] === "string") + $util.base64.decode(object.envMap[keys[i]], message.envMap[keys[i]] = $util.newBuffer($util.base64.length(object.envMap[keys[i]])), 0); + else if (object.envMap[keys[i]].length >= 0) + message.envMap[keys[i]] = object.envMap[keys[i]]; + } + return message; + }; + + /** + * Creates a plain object from an InlineSecret message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {google.devtools.cloudbuild.v1.InlineSecret} message InlineSecret + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineSecret.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.envMap = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + var keys2; + if (message.envMap && (keys2 = Object.keys(message.envMap)).length) { + object.envMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.envMap[keys2[j]] = options.bytes === String ? $util.base64.encode(message.envMap[keys2[j]], 0, message.envMap[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.envMap[keys2[j]]) : message.envMap[keys2[j]]; + } + return object; + }; + + /** + * Converts this InlineSecret to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @instance + * @returns {Object.} JSON object + */ + InlineSecret.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineSecret + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.InlineSecret + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineSecret.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.InlineSecret"; + }; + + return InlineSecret; + })(); + + v1.SecretManagerSecret = (function() { + + /** + * Properties of a SecretManagerSecret. + * @memberof google.devtools.cloudbuild.v1 + * @interface ISecretManagerSecret + * @property {string|null} [versionName] SecretManagerSecret versionName + * @property {string|null} [env] SecretManagerSecret env + */ + + /** + * Constructs a new SecretManagerSecret. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a SecretManagerSecret. + * @implements ISecretManagerSecret + * @constructor + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret=} [properties] Properties to set + */ + function SecretManagerSecret(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecretManagerSecret versionName. + * @member {string} versionName + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @instance + */ + SecretManagerSecret.prototype.versionName = ""; + + /** + * SecretManagerSecret env. + * @member {string} env + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @instance + */ + SecretManagerSecret.prototype.env = ""; + + /** + * Creates a new SecretManagerSecret instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret instance + */ + SecretManagerSecret.create = function create(properties) { + return new SecretManagerSecret(properties); + }; + + /** + * Encodes the specified SecretManagerSecret message. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret} message SecretManagerSecret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretManagerSecret.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionName != null && Object.hasOwnProperty.call(message, "versionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.versionName); + if (message.env != null && Object.hasOwnProperty.call(message, "env")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.env); + return writer; + }; + + /** + * Encodes the specified SecretManagerSecret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.SecretManagerSecret.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {google.devtools.cloudbuild.v1.ISecretManagerSecret} message SecretManagerSecret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecretManagerSecret.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecretManagerSecret message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretManagerSecret.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.SecretManagerSecret(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.versionName = reader.string(); + break; + } + case 2: { + message.env = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecretManagerSecret message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecretManagerSecret.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecretManagerSecret message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecretManagerSecret.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionName != null && message.hasOwnProperty("versionName")) + if (!$util.isString(message.versionName)) + return "versionName: string expected"; + if (message.env != null && message.hasOwnProperty("env")) + if (!$util.isString(message.env)) + return "env: string expected"; + return null; + }; + + /** + * Creates a SecretManagerSecret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.SecretManagerSecret} SecretManagerSecret + */ + SecretManagerSecret.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.SecretManagerSecret) + return object; + var message = new $root.google.devtools.cloudbuild.v1.SecretManagerSecret(); + if (object.versionName != null) + message.versionName = String(object.versionName); + if (object.env != null) + message.env = String(object.env); + return message; + }; + + /** + * Creates a plain object from a SecretManagerSecret message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {google.devtools.cloudbuild.v1.SecretManagerSecret} message SecretManagerSecret + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecretManagerSecret.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.versionName = ""; + object.env = ""; + } + if (message.versionName != null && message.hasOwnProperty("versionName")) + object.versionName = message.versionName; + if (message.env != null && message.hasOwnProperty("env")) + object.env = message.env; + return object; + }; + + /** + * Converts this SecretManagerSecret to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @instance + * @returns {Object.} JSON object + */ + SecretManagerSecret.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecretManagerSecret + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.SecretManagerSecret + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecretManagerSecret.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.SecretManagerSecret"; + }; + + return SecretManagerSecret; + })(); + + v1.Secret = (function() { + + /** + * Properties of a Secret. + * @memberof google.devtools.cloudbuild.v1 + * @interface ISecret + * @property {string|null} [kmsKeyName] Secret kmsKeyName + * @property {Object.|null} [secretEnv] Secret secretEnv + */ + + /** + * Constructs a new Secret. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a Secret. + * @implements ISecret + * @constructor + * @param {google.devtools.cloudbuild.v1.ISecret=} [properties] Properties to set + */ + function Secret(properties) { + this.secretEnv = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Secret kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.devtools.cloudbuild.v1.Secret + * @instance + */ + Secret.prototype.kmsKeyName = ""; + + /** + * Secret secretEnv. + * @member {Object.} secretEnv + * @memberof google.devtools.cloudbuild.v1.Secret + * @instance + */ + Secret.prototype.secretEnv = $util.emptyObject; + + /** + * Creates a new Secret instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {google.devtools.cloudbuild.v1.ISecret=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.Secret} Secret instance + */ + Secret.create = function create(properties) { + return new Secret(properties); + }; + + /** + * Encodes the specified Secret message. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {google.devtools.cloudbuild.v1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + if (message.secretEnv != null && Object.hasOwnProperty.call(message, "secretEnv")) + for (var keys = Object.keys(message.secretEnv), 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).bytes(message.secretEnv[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Secret message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Secret.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {google.devtools.cloudbuild.v1.ISecret} message Secret message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Secret.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Secret message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Secret(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = reader.string(); + break; + } + case 3: { + if (message.secretEnv === $util.emptyObject) + message.secretEnv = {}; + 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.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.secretEnv[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Secret message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.Secret} Secret + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Secret.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Secret message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Secret.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { + if (!$util.isObject(message.secretEnv)) + return "secretEnv: object expected"; + var key = Object.keys(message.secretEnv); + for (var i = 0; i < key.length; ++i) + if (!(message.secretEnv[key[i]] && typeof message.secretEnv[key[i]].length === "number" || $util.isString(message.secretEnv[key[i]]))) + return "secretEnv: buffer{k:string} expected"; + } + return null; + }; + + /** + * Creates a Secret message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.Secret} Secret + */ + Secret.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.Secret) + return object; + var message = new $root.google.devtools.cloudbuild.v1.Secret(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.secretEnv) { + if (typeof object.secretEnv !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.Secret.secretEnv: object expected"); + message.secretEnv = {}; + for (var keys = Object.keys(object.secretEnv), i = 0; i < keys.length; ++i) + if (typeof object.secretEnv[keys[i]] === "string") + $util.base64.decode(object.secretEnv[keys[i]], message.secretEnv[keys[i]] = $util.newBuffer($util.base64.length(object.secretEnv[keys[i]])), 0); + else if (object.secretEnv[keys[i]].length >= 0) + message.secretEnv[keys[i]] = object.secretEnv[keys[i]]; + } + return message; + }; + + /** + * Creates a plain object from a Secret message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {google.devtools.cloudbuild.v1.Secret} message Secret + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Secret.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.secretEnv = {}; + if (options.defaults) + object.kmsKeyName = ""; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + var keys2; + if (message.secretEnv && (keys2 = Object.keys(message.secretEnv)).length) { + object.secretEnv = {}; + for (var j = 0; j < keys2.length; ++j) + object.secretEnv[keys2[j]] = options.bytes === String ? $util.base64.encode(message.secretEnv[keys2[j]], 0, message.secretEnv[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.secretEnv[keys2[j]]) : message.secretEnv[keys2[j]]; + } + return object; + }; + + /** + * Converts this Secret to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.Secret + * @instance + * @returns {Object.} JSON object + */ + Secret.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Secret + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.Secret + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Secret.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.Secret"; + }; + + return Secret; + })(); + + v1.CreateBuildRequest = (function() { + + /** + * Properties of a CreateBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface ICreateBuildRequest + * @property {string|null} [parent] CreateBuildRequest parent + * @property {string|null} [projectId] CreateBuildRequest projectId + * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] CreateBuildRequest build + */ + + /** + * Constructs a new CreateBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CreateBuildRequest. + * @implements ICreateBuildRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest=} [properties] Properties to set + */ + function CreateBuildRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBuildRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @instance + */ + CreateBuildRequest.prototype.parent = ""; + + /** + * CreateBuildRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @instance + */ + CreateBuildRequest.prototype.projectId = ""; + + /** + * CreateBuildRequest build. + * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @instance + */ + CreateBuildRequest.prototype.build = null; + + /** + * Creates a new CreateBuildRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest instance + */ + CreateBuildRequest.create = function create(properties) { + return new CreateBuildRequest(properties); + }; + + /** + * Encodes the specified CreateBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} message CreateBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBuildRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + $root.google.devtools.cloudbuild.v1.Build.encode(message.build, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreateBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateBuildRequest} message CreateBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBuildRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBuildRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateBuildRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.parent = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBuildRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBuildRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBuildRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBuildRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.build != null && message.hasOwnProperty("build")) { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); + if (error) + return "build." + error; + } + return null; + }; + + /** + * Creates a CreateBuildRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.CreateBuildRequest} CreateBuildRequest + */ + CreateBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CreateBuildRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.build != null) { + if (typeof object.build !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateBuildRequest.build: object expected"); + message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); + } + return message; + }; + + /** + * Creates a plain object from a CreateBuildRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.CreateBuildRequest} message CreateBuildRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBuildRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.build = null; + object.parent = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.build != null && message.hasOwnProperty("build")) + object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreateBuildRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBuildRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBuildRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.CreateBuildRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.CreateBuildRequest"; + }; + + return CreateBuildRequest; + })(); + + v1.GetBuildRequest = (function() { + + /** + * Properties of a GetBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IGetBuildRequest + * @property {string|null} [name] GetBuildRequest name + * @property {string|null} [projectId] GetBuildRequest projectId + * @property {string|null} [id] GetBuildRequest id + */ + + /** + * Constructs a new GetBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a GetBuildRequest. + * @implements IGetBuildRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest=} [properties] Properties to set + */ + function GetBuildRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @instance + */ + GetBuildRequest.prototype.name = ""; + + /** + * GetBuildRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @instance + */ + GetBuildRequest.prototype.projectId = ""; + + /** + * GetBuildRequest id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @instance + */ + GetBuildRequest.prototype.id = ""; + + /** + * Creates a new GetBuildRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest instance + */ + GetBuildRequest.create = function create(properties) { + return new GetBuildRequest(properties); + }; + + /** + * Encodes the specified GetBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} message GetBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBuildRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetBuildRequest} message GetBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBuildRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBuildRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetBuildRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBuildRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBuildRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBuildRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBuildRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a GetBuildRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.GetBuildRequest} GetBuildRequest + */ + GetBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.GetBuildRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a GetBuildRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.GetBuildRequest} message GetBuildRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBuildRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.id = ""; + object.name = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBuildRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @instance + * @returns {Object.} JSON object + */ + GetBuildRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBuildRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.GetBuildRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.GetBuildRequest"; + }; + + return GetBuildRequest; + })(); + + v1.ListBuildsRequest = (function() { + + /** + * Properties of a ListBuildsRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IListBuildsRequest + * @property {string|null} [parent] ListBuildsRequest parent + * @property {string|null} [projectId] ListBuildsRequest projectId + * @property {number|null} [pageSize] ListBuildsRequest pageSize + * @property {string|null} [pageToken] ListBuildsRequest pageToken + * @property {string|null} [filter] ListBuildsRequest filter + */ + + /** + * Constructs a new ListBuildsRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ListBuildsRequest. + * @implements IListBuildsRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest=} [properties] Properties to set + */ + function ListBuildsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBuildsRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + */ + ListBuildsRequest.prototype.parent = ""; + + /** + * ListBuildsRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + */ + ListBuildsRequest.prototype.projectId = ""; + + /** + * ListBuildsRequest pageSize. + * @member {number} pageSize + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + */ + ListBuildsRequest.prototype.pageSize = 0; + + /** + * ListBuildsRequest pageToken. + * @member {string} pageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + */ + ListBuildsRequest.prototype.pageToken = ""; + + /** + * ListBuildsRequest filter. + * @member {string} filter + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + */ + ListBuildsRequest.prototype.filter = ""; + + /** + * Creates a new ListBuildsRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest instance + */ + ListBuildsRequest.create = function create(properties) { + return new ListBuildsRequest(properties); + }; + + /** + * Encodes the specified ListBuildsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} message ListBuildsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListBuildsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildsRequest} message ListBuildsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBuildsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: { + message.parent = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBuildsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBuildsRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBuildsRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListBuildsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListBuildsRequest} ListBuildsRequest + */ + ListBuildsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListBuildsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListBuildsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {google.devtools.cloudbuild.v1.ListBuildsRequest} message ListBuildsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBuildsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.parent = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListBuildsRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBuildsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBuildsRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ListBuildsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBuildsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ListBuildsRequest"; + }; + + return ListBuildsRequest; + })(); + + v1.ListBuildsResponse = (function() { + + /** + * Properties of a ListBuildsResponse. + * @memberof google.devtools.cloudbuild.v1 + * @interface IListBuildsResponse + * @property {Array.|null} [builds] ListBuildsResponse builds + * @property {string|null} [nextPageToken] ListBuildsResponse nextPageToken + */ + + /** + * Constructs a new ListBuildsResponse. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ListBuildsResponse. + * @implements IListBuildsResponse + * @constructor + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse=} [properties] Properties to set + */ + function ListBuildsResponse(properties) { + this.builds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBuildsResponse builds. + * @member {Array.} builds + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @instance + */ + ListBuildsResponse.prototype.builds = $util.emptyArray; + + /** + * ListBuildsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @instance + */ + ListBuildsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBuildsResponse instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse instance + */ + ListBuildsResponse.create = function create(properties) { + return new ListBuildsResponse(properties); + }; + + /** + * Encodes the specified ListBuildsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse} message ListBuildsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.builds != null && message.builds.length) + for (var i = 0; i < message.builds.length; ++i) + $root.google.devtools.cloudbuild.v1.Build.encode(message.builds[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 ListBuildsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildsResponse} message ListBuildsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBuildsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.builds && message.builds.length)) + message.builds = []; + message.builds.push($root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBuildsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBuildsResponse message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBuildsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.builds != null && message.hasOwnProperty("builds")) { + if (!Array.isArray(message.builds)) + return "builds: array expected"; + for (var i = 0; i < message.builds.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.builds[i]); + if (error) + return "builds." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBuildsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListBuildsResponse} ListBuildsResponse + */ + ListBuildsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildsResponse) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListBuildsResponse(); + if (object.builds) { + if (!Array.isArray(object.builds)) + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildsResponse.builds: array expected"); + message.builds = []; + for (var i = 0; i < object.builds.length; ++i) { + if (typeof object.builds[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildsResponse.builds: object expected"); + message.builds[i] = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.builds[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBuildsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {google.devtools.cloudbuild.v1.ListBuildsResponse} message ListBuildsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBuildsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.builds = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.builds && message.builds.length) { + object.builds = []; + for (var j = 0; j < message.builds.length; ++j) + object.builds[j] = $root.google.devtools.cloudbuild.v1.Build.toObject(message.builds[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBuildsResponse to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBuildsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBuildsResponse + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ListBuildsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBuildsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ListBuildsResponse"; + }; + + return ListBuildsResponse; + })(); + + v1.CancelBuildRequest = (function() { + + /** + * Properties of a CancelBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface ICancelBuildRequest + * @property {string|null} [name] CancelBuildRequest name + * @property {string|null} [projectId] CancelBuildRequest projectId + * @property {string|null} [id] CancelBuildRequest id + */ + + /** + * Constructs a new CancelBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CancelBuildRequest. + * @implements ICancelBuildRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest=} [properties] Properties to set + */ + function CancelBuildRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @instance + */ + CancelBuildRequest.prototype.name = ""; + + /** + * CancelBuildRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @instance + */ + CancelBuildRequest.prototype.projectId = ""; + + /** + * CancelBuildRequest id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @instance + */ + CancelBuildRequest.prototype.id = ""; + + /** + * Creates a new CancelBuildRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest instance + */ + CancelBuildRequest.create = function create(properties) { + return new CancelBuildRequest(properties); + }; + + /** + * Encodes the specified CancelBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} message CancelBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelBuildRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CancelBuildRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICancelBuildRequest} message CancelBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelBuildRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelBuildRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CancelBuildRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.id = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelBuildRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelBuildRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelBuildRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelBuildRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a CancelBuildRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.CancelBuildRequest} CancelBuildRequest + */ + CancelBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CancelBuildRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CancelBuildRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a CancelBuildRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.CancelBuildRequest} message CancelBuildRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelBuildRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.id = ""; + object.name = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelBuildRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @instance + * @returns {Object.} JSON object + */ + CancelBuildRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelBuildRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.CancelBuildRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.CancelBuildRequest"; + }; + + return CancelBuildRequest; + })(); + + v1.ApproveBuildRequest = (function() { + + /** + * Properties of an ApproveBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IApproveBuildRequest + * @property {string|null} [name] ApproveBuildRequest name + * @property {google.devtools.cloudbuild.v1.IApprovalResult|null} [approvalResult] ApproveBuildRequest approvalResult + */ + + /** + * Constructs a new ApproveBuildRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an ApproveBuildRequest. + * @implements IApproveBuildRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IApproveBuildRequest=} [properties] Properties to set + */ + function ApproveBuildRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApproveBuildRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @instance + */ + ApproveBuildRequest.prototype.name = ""; + + /** + * ApproveBuildRequest approvalResult. + * @member {google.devtools.cloudbuild.v1.IApprovalResult|null|undefined} approvalResult + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @instance + */ + ApproveBuildRequest.prototype.approvalResult = null; + + /** + * Creates a new ApproveBuildRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IApproveBuildRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ApproveBuildRequest} ApproveBuildRequest instance + */ + ApproveBuildRequest.create = function create(properties) { + return new ApproveBuildRequest(properties); + }; + + /** + * Encodes the specified ApproveBuildRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ApproveBuildRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IApproveBuildRequest} message ApproveBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveBuildRequest.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.approvalResult != null && Object.hasOwnProperty.call(message, "approvalResult")) + $root.google.devtools.cloudbuild.v1.ApprovalResult.encode(message.approvalResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApproveBuildRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ApproveBuildRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.IApproveBuildRequest} message ApproveBuildRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApproveBuildRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApproveBuildRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ApproveBuildRequest} ApproveBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveBuildRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ApproveBuildRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.approvalResult = $root.google.devtools.cloudbuild.v1.ApprovalResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApproveBuildRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ApproveBuildRequest} ApproveBuildRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApproveBuildRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApproveBuildRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApproveBuildRequest.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.approvalResult != null && message.hasOwnProperty("approvalResult")) { + var error = $root.google.devtools.cloudbuild.v1.ApprovalResult.verify(message.approvalResult); + if (error) + return "approvalResult." + error; + } + return null; + }; + + /** + * Creates an ApproveBuildRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ApproveBuildRequest} ApproveBuildRequest + */ + ApproveBuildRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ApproveBuildRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ApproveBuildRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.approvalResult != null) { + if (typeof object.approvalResult !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ApproveBuildRequest.approvalResult: object expected"); + message.approvalResult = $root.google.devtools.cloudbuild.v1.ApprovalResult.fromObject(object.approvalResult); + } + return message; + }; + + /** + * Creates a plain object from an ApproveBuildRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {google.devtools.cloudbuild.v1.ApproveBuildRequest} message ApproveBuildRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApproveBuildRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.approvalResult = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.approvalResult != null && message.hasOwnProperty("approvalResult")) + object.approvalResult = $root.google.devtools.cloudbuild.v1.ApprovalResult.toObject(message.approvalResult, options); + return object; + }; + + /** + * Converts this ApproveBuildRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @instance + * @returns {Object.} JSON object + */ + ApproveBuildRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApproveBuildRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ApproveBuildRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApproveBuildRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ApproveBuildRequest"; + }; + + return ApproveBuildRequest; + })(); + + v1.BuildApproval = (function() { + + /** + * Properties of a BuildApproval. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuildApproval + * @property {google.devtools.cloudbuild.v1.BuildApproval.State|null} [state] BuildApproval state + * @property {google.devtools.cloudbuild.v1.IApprovalConfig|null} [config] BuildApproval config + * @property {google.devtools.cloudbuild.v1.IApprovalResult|null} [result] BuildApproval result + */ + + /** + * Constructs a new BuildApproval. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuildApproval. + * @implements IBuildApproval + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuildApproval=} [properties] Properties to set + */ + function BuildApproval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildApproval state. + * @member {google.devtools.cloudbuild.v1.BuildApproval.State} state + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @instance + */ + BuildApproval.prototype.state = 0; + + /** + * BuildApproval config. + * @member {google.devtools.cloudbuild.v1.IApprovalConfig|null|undefined} config + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @instance + */ + BuildApproval.prototype.config = null; + + /** + * BuildApproval result. + * @member {google.devtools.cloudbuild.v1.IApprovalResult|null|undefined} result + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @instance + */ + BuildApproval.prototype.result = null; + + /** + * Creates a new BuildApproval instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {google.devtools.cloudbuild.v1.IBuildApproval=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildApproval} BuildApproval instance + */ + BuildApproval.create = function create(properties) { + return new BuildApproval(properties); + }; + + /** + * Encodes the specified BuildApproval message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildApproval.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {google.devtools.cloudbuild.v1.IBuildApproval} message BuildApproval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildApproval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.devtools.cloudbuild.v1.ApprovalConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.devtools.cloudbuild.v1.ApprovalResult.encode(message.result, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BuildApproval message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildApproval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {google.devtools.cloudbuild.v1.IBuildApproval} message BuildApproval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildApproval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildApproval message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildApproval} BuildApproval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildApproval.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildApproval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.config = $root.google.devtools.cloudbuild.v1.ApprovalConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.result = $root.google.devtools.cloudbuild.v1.ApprovalResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildApproval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildApproval} BuildApproval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildApproval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildApproval message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildApproval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.devtools.cloudbuild.v1.ApprovalConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.google.devtools.cloudbuild.v1.ApprovalResult.verify(message.result); + if (error) + return "result." + error; + } + return null; + }; + + /** + * Creates a BuildApproval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildApproval} BuildApproval + */ + BuildApproval.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildApproval) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildApproval(); + 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 "PENDING": + case 1: + message.state = 1; + break; + case "APPROVED": + case 2: + message.state = 2; + break; + case "REJECTED": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 5: + message.state = 5; + break; + } + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildApproval.config: object expected"); + message.config = $root.google.devtools.cloudbuild.v1.ApprovalConfig.fromObject(object.config); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildApproval.result: object expected"); + message.result = $root.google.devtools.cloudbuild.v1.ApprovalResult.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a BuildApproval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {google.devtools.cloudbuild.v1.BuildApproval} message BuildApproval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildApproval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.config = null; + object.result = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildApproval.State[message.state] === undefined ? message.state : $root.google.devtools.cloudbuild.v1.BuildApproval.State[message.state] : message.state; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.devtools.cloudbuild.v1.ApprovalConfig.toObject(message.config, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.google.devtools.cloudbuild.v1.ApprovalResult.toObject(message.result, options); + return object; + }; + + /** + * Converts this BuildApproval to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @instance + * @returns {Object.} JSON object + */ + BuildApproval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildApproval + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuildApproval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildApproval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuildApproval"; + }; + + /** + * State enum. + * @name google.devtools.cloudbuild.v1.BuildApproval.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} APPROVED=2 APPROVED value + * @property {number} REJECTED=3 REJECTED value + * @property {number} CANCELLED=5 CANCELLED value + */ + BuildApproval.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "APPROVED"] = 2; + values[valuesById[3] = "REJECTED"] = 3; + values[valuesById[5] = "CANCELLED"] = 5; + return values; + })(); + + return BuildApproval; + })(); + + v1.ApprovalConfig = (function() { + + /** + * Properties of an ApprovalConfig. + * @memberof google.devtools.cloudbuild.v1 + * @interface IApprovalConfig + * @property {boolean|null} [approvalRequired] ApprovalConfig approvalRequired + */ + + /** + * Constructs a new ApprovalConfig. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an ApprovalConfig. + * @implements IApprovalConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.IApprovalConfig=} [properties] Properties to set + */ + function ApprovalConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApprovalConfig approvalRequired. + * @member {boolean} approvalRequired + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @instance + */ + ApprovalConfig.prototype.approvalRequired = false; + + /** + * Creates a new ApprovalConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {google.devtools.cloudbuild.v1.IApprovalConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ApprovalConfig} ApprovalConfig instance + */ + ApprovalConfig.create = function create(properties) { + return new ApprovalConfig(properties); + }; + + /** + * Encodes the specified ApprovalConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {google.devtools.cloudbuild.v1.IApprovalConfig} message ApprovalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApprovalConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.approvalRequired != null && Object.hasOwnProperty.call(message, "approvalRequired")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.approvalRequired); + return writer; + }; + + /** + * Encodes the specified ApprovalConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {google.devtools.cloudbuild.v1.IApprovalConfig} message ApprovalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApprovalConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApprovalConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ApprovalConfig} ApprovalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApprovalConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ApprovalConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.approvalRequired = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApprovalConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ApprovalConfig} ApprovalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApprovalConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApprovalConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApprovalConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.approvalRequired != null && message.hasOwnProperty("approvalRequired")) + if (typeof message.approvalRequired !== "boolean") + return "approvalRequired: boolean expected"; + return null; + }; + + /** + * Creates an ApprovalConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ApprovalConfig} ApprovalConfig + */ + ApprovalConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ApprovalConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ApprovalConfig(); + if (object.approvalRequired != null) + message.approvalRequired = Boolean(object.approvalRequired); + return message; + }; + + /** + * Creates a plain object from an ApprovalConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {google.devtools.cloudbuild.v1.ApprovalConfig} message ApprovalConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApprovalConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.approvalRequired = false; + if (message.approvalRequired != null && message.hasOwnProperty("approvalRequired")) + object.approvalRequired = message.approvalRequired; + return object; + }; + + /** + * Converts this ApprovalConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @instance + * @returns {Object.} JSON object + */ + ApprovalConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApprovalConfig + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ApprovalConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApprovalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ApprovalConfig"; + }; + + return ApprovalConfig; + })(); + + v1.ApprovalResult = (function() { + + /** + * Properties of an ApprovalResult. + * @memberof google.devtools.cloudbuild.v1 + * @interface IApprovalResult + * @property {string|null} [approverAccount] ApprovalResult approverAccount + * @property {google.protobuf.ITimestamp|null} [approvalTime] ApprovalResult approvalTime + * @property {google.devtools.cloudbuild.v1.ApprovalResult.Decision|null} [decision] ApprovalResult decision + * @property {string|null} [comment] ApprovalResult comment + * @property {string|null} [url] ApprovalResult url + */ + + /** + * Constructs a new ApprovalResult. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an ApprovalResult. + * @implements IApprovalResult + * @constructor + * @param {google.devtools.cloudbuild.v1.IApprovalResult=} [properties] Properties to set + */ + function ApprovalResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApprovalResult approverAccount. + * @member {string} approverAccount + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @instance + */ + ApprovalResult.prototype.approverAccount = ""; + + /** + * ApprovalResult approvalTime. + * @member {google.protobuf.ITimestamp|null|undefined} approvalTime + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @instance + */ + ApprovalResult.prototype.approvalTime = null; + + /** + * ApprovalResult decision. + * @member {google.devtools.cloudbuild.v1.ApprovalResult.Decision} decision + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @instance + */ + ApprovalResult.prototype.decision = 0; + + /** + * ApprovalResult comment. + * @member {string} comment + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @instance + */ + ApprovalResult.prototype.comment = ""; + + /** + * ApprovalResult url. + * @member {string} url + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @instance + */ + ApprovalResult.prototype.url = ""; + + /** + * Creates a new ApprovalResult instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {google.devtools.cloudbuild.v1.IApprovalResult=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ApprovalResult} ApprovalResult instance + */ + ApprovalResult.create = function create(properties) { + return new ApprovalResult(properties); + }; + + /** + * Encodes the specified ApprovalResult message. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalResult.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {google.devtools.cloudbuild.v1.IApprovalResult} message ApprovalResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApprovalResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.approverAccount != null && Object.hasOwnProperty.call(message, "approverAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.approverAccount); + if (message.approvalTime != null && Object.hasOwnProperty.call(message, "approvalTime")) + $root.google.protobuf.Timestamp.encode(message.approvalTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.decision != null && Object.hasOwnProperty.call(message, "decision")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.decision); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.comment); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.url); + return writer; + }; + + /** + * Encodes the specified ApprovalResult message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ApprovalResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {google.devtools.cloudbuild.v1.IApprovalResult} message ApprovalResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApprovalResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApprovalResult message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ApprovalResult} ApprovalResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApprovalResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ApprovalResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.approverAccount = reader.string(); + break; + } + case 3: { + message.approvalTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.decision = reader.int32(); + break; + } + case 5: { + message.comment = reader.string(); + break; + } + case 6: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApprovalResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ApprovalResult} ApprovalResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApprovalResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApprovalResult message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApprovalResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.approverAccount != null && message.hasOwnProperty("approverAccount")) + if (!$util.isString(message.approverAccount)) + return "approverAccount: string expected"; + if (message.approvalTime != null && message.hasOwnProperty("approvalTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.approvalTime); + if (error) + return "approvalTime." + error; + } + if (message.decision != null && message.hasOwnProperty("decision")) + switch (message.decision) { + default: + return "decision: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.comment != null && message.hasOwnProperty("comment")) + if (!$util.isString(message.comment)) + return "comment: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; + + /** + * Creates an ApprovalResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ApprovalResult} ApprovalResult + */ + ApprovalResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ApprovalResult) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ApprovalResult(); + if (object.approverAccount != null) + message.approverAccount = String(object.approverAccount); + if (object.approvalTime != null) { + if (typeof object.approvalTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ApprovalResult.approvalTime: object expected"); + message.approvalTime = $root.google.protobuf.Timestamp.fromObject(object.approvalTime); + } + switch (object.decision) { + default: + if (typeof object.decision === "number") { + message.decision = object.decision; + break; + } + break; + case "DECISION_UNSPECIFIED": + case 0: + message.decision = 0; + break; + case "APPROVED": + case 1: + message.decision = 1; + break; + case "REJECTED": + case 2: + message.decision = 2; + break; + } + if (object.comment != null) + message.comment = String(object.comment); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from an ApprovalResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {google.devtools.cloudbuild.v1.ApprovalResult} message ApprovalResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApprovalResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.approverAccount = ""; + object.approvalTime = null; + object.decision = options.enums === String ? "DECISION_UNSPECIFIED" : 0; + object.comment = ""; + object.url = ""; + } + if (message.approverAccount != null && message.hasOwnProperty("approverAccount")) + object.approverAccount = message.approverAccount; + if (message.approvalTime != null && message.hasOwnProperty("approvalTime")) + object.approvalTime = $root.google.protobuf.Timestamp.toObject(message.approvalTime, options); + if (message.decision != null && message.hasOwnProperty("decision")) + object.decision = options.enums === String ? $root.google.devtools.cloudbuild.v1.ApprovalResult.Decision[message.decision] === undefined ? message.decision : $root.google.devtools.cloudbuild.v1.ApprovalResult.Decision[message.decision] : message.decision; + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = message.comment; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; + + /** + * Converts this ApprovalResult to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @instance + * @returns {Object.} JSON object + */ + ApprovalResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApprovalResult + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ApprovalResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApprovalResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ApprovalResult"; + }; + + /** + * Decision enum. + * @name google.devtools.cloudbuild.v1.ApprovalResult.Decision + * @enum {number} + * @property {number} DECISION_UNSPECIFIED=0 DECISION_UNSPECIFIED value + * @property {number} APPROVED=1 APPROVED value + * @property {number} REJECTED=2 REJECTED value + */ + ApprovalResult.Decision = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECISION_UNSPECIFIED"] = 0; + values[valuesById[1] = "APPROVED"] = 1; + values[valuesById[2] = "REJECTED"] = 2; + return values; + })(); + + return ApprovalResult; + })(); + + v1.BuildTrigger = (function() { + + /** + * Properties of a BuildTrigger. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuildTrigger + * @property {string|null} [resourceName] BuildTrigger resourceName + * @property {string|null} [id] BuildTrigger id + * @property {string|null} [description] BuildTrigger description + * @property {string|null} [name] BuildTrigger name + * @property {Array.|null} [tags] BuildTrigger tags + * @property {google.devtools.cloudbuild.v1.IRepoSource|null} [triggerTemplate] BuildTrigger triggerTemplate + * @property {google.devtools.cloudbuild.v1.IGitHubEventsConfig|null} [github] BuildTrigger github + * @property {google.devtools.cloudbuild.v1.IPubsubConfig|null} [pubsubConfig] BuildTrigger pubsubConfig + * @property {google.devtools.cloudbuild.v1.IWebhookConfig|null} [webhookConfig] BuildTrigger webhookConfig + * @property {boolean|null} [autodetect] BuildTrigger autodetect + * @property {google.devtools.cloudbuild.v1.IBuild|null} [build] BuildTrigger build + * @property {string|null} [filename] BuildTrigger filename + * @property {google.protobuf.ITimestamp|null} [createTime] BuildTrigger createTime + * @property {boolean|null} [disabled] BuildTrigger disabled + * @property {Object.|null} [substitutions] BuildTrigger substitutions + * @property {Array.|null} [ignoredFiles] BuildTrigger ignoredFiles + * @property {Array.|null} [includedFiles] BuildTrigger includedFiles + * @property {string|null} [filter] BuildTrigger filter + * @property {string|null} [serviceAccount] BuildTrigger serviceAccount + */ + + /** + * Constructs a new BuildTrigger. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuildTrigger. + * @implements IBuildTrigger + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuildTrigger=} [properties] Properties to set + */ + function BuildTrigger(properties) { + this.tags = []; + this.substitutions = {}; + this.ignoredFiles = []; + this.includedFiles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildTrigger resourceName. + * @member {string} resourceName + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.resourceName = ""; + + /** + * BuildTrigger id. + * @member {string} id + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.id = ""; + + /** + * BuildTrigger description. + * @member {string} description + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.description = ""; + + /** + * BuildTrigger name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.name = ""; + + /** + * BuildTrigger tags. + * @member {Array.} tags + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.tags = $util.emptyArray; + + /** + * BuildTrigger triggerTemplate. + * @member {google.devtools.cloudbuild.v1.IRepoSource|null|undefined} triggerTemplate + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.triggerTemplate = null; + + /** + * BuildTrigger github. + * @member {google.devtools.cloudbuild.v1.IGitHubEventsConfig|null|undefined} github + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.github = null; + + /** + * BuildTrigger pubsubConfig. + * @member {google.devtools.cloudbuild.v1.IPubsubConfig|null|undefined} pubsubConfig + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.pubsubConfig = null; + + /** + * BuildTrigger webhookConfig. + * @member {google.devtools.cloudbuild.v1.IWebhookConfig|null|undefined} webhookConfig + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.webhookConfig = null; + + /** + * BuildTrigger autodetect. + * @member {boolean|null|undefined} autodetect + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.autodetect = null; + + /** + * BuildTrigger build. + * @member {google.devtools.cloudbuild.v1.IBuild|null|undefined} build + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.build = null; + + /** + * BuildTrigger filename. + * @member {string|null|undefined} filename + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.filename = null; + + /** + * BuildTrigger createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.createTime = null; + + /** + * BuildTrigger disabled. + * @member {boolean} disabled + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.disabled = false; + + /** + * BuildTrigger substitutions. + * @member {Object.} substitutions + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.substitutions = $util.emptyObject; + + /** + * BuildTrigger ignoredFiles. + * @member {Array.} ignoredFiles + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.ignoredFiles = $util.emptyArray; + + /** + * BuildTrigger includedFiles. + * @member {Array.} includedFiles + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.includedFiles = $util.emptyArray; + + /** + * BuildTrigger filter. + * @member {string} filter + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.filter = ""; + + /** + * BuildTrigger serviceAccount. + * @member {string} serviceAccount + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + BuildTrigger.prototype.serviceAccount = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BuildTrigger buildTemplate. + * @member {"autodetect"|"build"|"filename"|undefined} buildTemplate + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + */ + Object.defineProperty(BuildTrigger.prototype, "buildTemplate", { + get: $util.oneOfGetter($oneOfFields = ["autodetect", "build", "filename"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BuildTrigger instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {google.devtools.cloudbuild.v1.IBuildTrigger=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger instance + */ + BuildTrigger.create = function create(properties) { + return new BuildTrigger(properties); + }; + + /** + * Encodes the specified BuildTrigger message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {google.devtools.cloudbuild.v1.IBuildTrigger} message BuildTrigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildTrigger.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.build != null && Object.hasOwnProperty.call(message, "build")) + $root.google.devtools.cloudbuild.v1.Build.encode(message.build, 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.triggerTemplate != null && Object.hasOwnProperty.call(message, "triggerTemplate")) + $root.google.devtools.cloudbuild.v1.RepoSource.encode(message.triggerTemplate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filename); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.disabled); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.substitutions != null && Object.hasOwnProperty.call(message, "substitutions")) + for (var keys = Object.keys(message.substitutions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.substitutions[keys[i]]).ldelim(); + if (message.github != null && Object.hasOwnProperty.call(message, "github")) + $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.encode(message.github, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.ignoredFiles != null && message.ignoredFiles.length) + for (var i = 0; i < message.ignoredFiles.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.ignoredFiles[i]); + if (message.includedFiles != null && message.includedFiles.length) + for (var i = 0; i < message.includedFiles.length; ++i) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.includedFiles[i]); + if (message.autodetect != null && Object.hasOwnProperty.call(message, "autodetect")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.autodetect); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.tags[i]); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.name); + if (message.pubsubConfig != null && Object.hasOwnProperty.call(message, "pubsubConfig")) + $root.google.devtools.cloudbuild.v1.PubsubConfig.encode(message.pubsubConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 30, wireType 2 =*/242).string(message.filter); + if (message.webhookConfig != null && Object.hasOwnProperty.call(message, "webhookConfig")) + $root.google.devtools.cloudbuild.v1.WebhookConfig.encode(message.webhookConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.serviceAccount); + if (message.resourceName != null && Object.hasOwnProperty.call(message, "resourceName")) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.resourceName); + return writer; + }; + + /** + * Encodes the specified BuildTrigger message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildTrigger.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {google.devtools.cloudbuild.v1.IBuildTrigger} message BuildTrigger message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildTrigger.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildTrigger message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildTrigger.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildTrigger(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.resourceName = reader.string(); + break; + } + case 1: { + message.id = reader.string(); + break; + } + case 10: { + message.description = reader.string(); + break; + } + case 21: { + message.name = reader.string(); + break; + } + case 19: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 7: { + message.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.decode(reader, reader.uint32()); + break; + } + case 13: { + message.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.decode(reader, reader.uint32()); + break; + } + case 29: { + message.pubsubConfig = $root.google.devtools.cloudbuild.v1.PubsubConfig.decode(reader, reader.uint32()); + break; + } + case 31: { + message.webhookConfig = $root.google.devtools.cloudbuild.v1.WebhookConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.autodetect = reader.bool(); + break; + } + case 4: { + message.build = $root.google.devtools.cloudbuild.v1.Build.decode(reader, reader.uint32()); + break; + } + case 8: { + message.filename = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.disabled = reader.bool(); + break; + } + case 11: { + if (message.substitutions === $util.emptyObject) + message.substitutions = {}; + 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.substitutions[key] = value; + break; + } + case 15: { + if (!(message.ignoredFiles && message.ignoredFiles.length)) + message.ignoredFiles = []; + message.ignoredFiles.push(reader.string()); + break; + } + case 16: { + if (!(message.includedFiles && message.includedFiles.length)) + message.includedFiles = []; + message.includedFiles.push(reader.string()); + break; + } + case 30: { + message.filter = reader.string(); + break; + } + case 33: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildTrigger message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildTrigger.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildTrigger message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildTrigger.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + if (!$util.isString(message.resourceName)) + return "resourceName: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.triggerTemplate != null && message.hasOwnProperty("triggerTemplate")) { + var error = $root.google.devtools.cloudbuild.v1.RepoSource.verify(message.triggerTemplate); + if (error) + return "triggerTemplate." + error; + } + if (message.github != null && message.hasOwnProperty("github")) { + var error = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.verify(message.github); + if (error) + return "github." + error; + } + if (message.pubsubConfig != null && message.hasOwnProperty("pubsubConfig")) { + var error = $root.google.devtools.cloudbuild.v1.PubsubConfig.verify(message.pubsubConfig); + if (error) + return "pubsubConfig." + error; + } + if (message.webhookConfig != null && message.hasOwnProperty("webhookConfig")) { + var error = $root.google.devtools.cloudbuild.v1.WebhookConfig.verify(message.webhookConfig); + if (error) + return "webhookConfig." + error; + } + if (message.autodetect != null && message.hasOwnProperty("autodetect")) { + properties.buildTemplate = 1; + if (typeof message.autodetect !== "boolean") + return "autodetect: boolean expected"; + } + if (message.build != null && message.hasOwnProperty("build")) { + if (properties.buildTemplate === 1) + return "buildTemplate: multiple values"; + properties.buildTemplate = 1; + { + var error = $root.google.devtools.cloudbuild.v1.Build.verify(message.build); + if (error) + return "build." + error; + } + } + if (message.filename != null && message.hasOwnProperty("filename")) { + if (properties.buildTemplate === 1) + return "buildTemplate: multiple values"; + properties.buildTemplate = 1; + if (!$util.isString(message.filename)) + return "filename: string expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + if (message.substitutions != null && message.hasOwnProperty("substitutions")) { + if (!$util.isObject(message.substitutions)) + return "substitutions: object expected"; + var key = Object.keys(message.substitutions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.substitutions[key[i]])) + return "substitutions: string{k:string} expected"; + } + if (message.ignoredFiles != null && message.hasOwnProperty("ignoredFiles")) { + if (!Array.isArray(message.ignoredFiles)) + return "ignoredFiles: array expected"; + for (var i = 0; i < message.ignoredFiles.length; ++i) + if (!$util.isString(message.ignoredFiles[i])) + return "ignoredFiles: string[] expected"; + } + if (message.includedFiles != null && message.hasOwnProperty("includedFiles")) { + if (!Array.isArray(message.includedFiles)) + return "includedFiles: array expected"; + for (var i = 0; i < message.includedFiles.length; ++i) + if (!$util.isString(message.includedFiles[i])) + return "includedFiles: string[] expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates a BuildTrigger message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildTrigger} BuildTrigger + */ + BuildTrigger.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildTrigger) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildTrigger(); + if (object.resourceName != null) + message.resourceName = String(object.resourceName); + if (object.id != null) + message.id = String(object.id); + if (object.description != null) + message.description = String(object.description); + if (object.name != null) + message.name = String(object.name); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.triggerTemplate != null) { + if (typeof object.triggerTemplate !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.triggerTemplate: object expected"); + message.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.fromObject(object.triggerTemplate); + } + if (object.github != null) { + if (typeof object.github !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.github: object expected"); + message.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.fromObject(object.github); + } + if (object.pubsubConfig != null) { + if (typeof object.pubsubConfig !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.pubsubConfig: object expected"); + message.pubsubConfig = $root.google.devtools.cloudbuild.v1.PubsubConfig.fromObject(object.pubsubConfig); + } + if (object.webhookConfig != null) { + if (typeof object.webhookConfig !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.webhookConfig: object expected"); + message.webhookConfig = $root.google.devtools.cloudbuild.v1.WebhookConfig.fromObject(object.webhookConfig); + } + if (object.autodetect != null) + message.autodetect = Boolean(object.autodetect); + if (object.build != null) { + if (typeof object.build !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.build: object expected"); + message.build = $root.google.devtools.cloudbuild.v1.Build.fromObject(object.build); + } + if (object.filename != null) + message.filename = String(object.filename); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.substitutions) { + if (typeof object.substitutions !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.substitutions: object expected"); + message.substitutions = {}; + for (var keys = Object.keys(object.substitutions), i = 0; i < keys.length; ++i) + message.substitutions[keys[i]] = String(object.substitutions[keys[i]]); + } + if (object.ignoredFiles) { + if (!Array.isArray(object.ignoredFiles)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.ignoredFiles: array expected"); + message.ignoredFiles = []; + for (var i = 0; i < object.ignoredFiles.length; ++i) + message.ignoredFiles[i] = String(object.ignoredFiles[i]); + } + if (object.includedFiles) { + if (!Array.isArray(object.includedFiles)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildTrigger.includedFiles: array expected"); + message.includedFiles = []; + for (var i = 0; i < object.includedFiles.length; ++i) + message.includedFiles[i] = String(object.includedFiles[i]); + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from a BuildTrigger message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {google.devtools.cloudbuild.v1.BuildTrigger} message BuildTrigger + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildTrigger.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredFiles = []; + object.includedFiles = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.substitutions = {}; + if (options.defaults) { + object.id = ""; + object.createTime = null; + object.triggerTemplate = null; + object.disabled = false; + object.description = ""; + object.github = null; + object.name = ""; + object.pubsubConfig = null; + object.filter = ""; + object.webhookConfig = null; + object.serviceAccount = ""; + object.resourceName = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.build != null && message.hasOwnProperty("build")) { + object.build = $root.google.devtools.cloudbuild.v1.Build.toObject(message.build, options); + if (options.oneofs) + object.buildTemplate = "build"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.triggerTemplate != null && message.hasOwnProperty("triggerTemplate")) + object.triggerTemplate = $root.google.devtools.cloudbuild.v1.RepoSource.toObject(message.triggerTemplate, options); + if (message.filename != null && message.hasOwnProperty("filename")) { + object.filename = message.filename; + if (options.oneofs) + object.buildTemplate = "filename"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.substitutions && (keys2 = Object.keys(message.substitutions)).length) { + object.substitutions = {}; + for (var j = 0; j < keys2.length; ++j) + object.substitutions[keys2[j]] = message.substitutions[keys2[j]]; + } + if (message.github != null && message.hasOwnProperty("github")) + object.github = $root.google.devtools.cloudbuild.v1.GitHubEventsConfig.toObject(message.github, options); + if (message.ignoredFiles && message.ignoredFiles.length) { + object.ignoredFiles = []; + for (var j = 0; j < message.ignoredFiles.length; ++j) + object.ignoredFiles[j] = message.ignoredFiles[j]; + } + if (message.includedFiles && message.includedFiles.length) { + object.includedFiles = []; + for (var j = 0; j < message.includedFiles.length; ++j) + object.includedFiles[j] = message.includedFiles[j]; + } + if (message.autodetect != null && message.hasOwnProperty("autodetect")) { + object.autodetect = message.autodetect; + if (options.oneofs) + object.buildTemplate = "autodetect"; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pubsubConfig != null && message.hasOwnProperty("pubsubConfig")) + object.pubsubConfig = $root.google.devtools.cloudbuild.v1.PubsubConfig.toObject(message.pubsubConfig, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.webhookConfig != null && message.hasOwnProperty("webhookConfig")) + object.webhookConfig = $root.google.devtools.cloudbuild.v1.WebhookConfig.toObject(message.webhookConfig, options); + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.resourceName != null && message.hasOwnProperty("resourceName")) + object.resourceName = message.resourceName; + return object; + }; + + /** + * Converts this BuildTrigger to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @instance + * @returns {Object.} JSON object + */ + BuildTrigger.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildTrigger + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuildTrigger + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildTrigger.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuildTrigger"; + }; + + return BuildTrigger; + })(); + + v1.GitHubEventsConfig = (function() { + + /** + * Properties of a GitHubEventsConfig. + * @memberof google.devtools.cloudbuild.v1 + * @interface IGitHubEventsConfig + * @property {number|Long|null} [installationId] GitHubEventsConfig installationId + * @property {string|null} [owner] GitHubEventsConfig owner + * @property {string|null} [name] GitHubEventsConfig name + * @property {google.devtools.cloudbuild.v1.IPullRequestFilter|null} [pullRequest] GitHubEventsConfig pullRequest + * @property {google.devtools.cloudbuild.v1.IPushFilter|null} [push] GitHubEventsConfig push + */ + + /** + * Constructs a new GitHubEventsConfig. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a GitHubEventsConfig. + * @implements IGitHubEventsConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig=} [properties] Properties to set + */ + function GitHubEventsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GitHubEventsConfig installationId. + * @member {number|Long} installationId + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.installationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GitHubEventsConfig owner. + * @member {string} owner + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.owner = ""; + + /** + * GitHubEventsConfig name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.name = ""; + + /** + * GitHubEventsConfig pullRequest. + * @member {google.devtools.cloudbuild.v1.IPullRequestFilter|null|undefined} pullRequest + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.pullRequest = null; + + /** + * GitHubEventsConfig push. + * @member {google.devtools.cloudbuild.v1.IPushFilter|null|undefined} push + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + GitHubEventsConfig.prototype.push = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GitHubEventsConfig event. + * @member {"pullRequest"|"push"|undefined} event + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + */ + Object.defineProperty(GitHubEventsConfig.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["pullRequest", "push"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GitHubEventsConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig instance + */ + GitHubEventsConfig.create = function create(properties) { + return new GitHubEventsConfig(properties); + }; + + /** + * Encodes the specified GitHubEventsConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig} message GitHubEventsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitHubEventsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.installationId != null && Object.hasOwnProperty.call(message, "installationId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.installationId); + if (message.pullRequest != null && Object.hasOwnProperty.call(message, "pullRequest")) + $root.google.devtools.cloudbuild.v1.PullRequestFilter.encode(message.pullRequest, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.push != null && Object.hasOwnProperty.call(message, "push")) + $root.google.devtools.cloudbuild.v1.PushFilter.encode(message.push, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.owner); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.name); + return writer; + }; + + /** + * Encodes the specified GitHubEventsConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GitHubEventsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {google.devtools.cloudbuild.v1.IGitHubEventsConfig} message GitHubEventsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitHubEventsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GitHubEventsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitHubEventsConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GitHubEventsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.installationId = reader.int64(); + break; + } + case 6: { + message.owner = reader.string(); + break; + } + case 7: { + message.name = reader.string(); + break; + } + case 4: { + message.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.decode(reader, reader.uint32()); + break; + } + case 5: { + message.push = $root.google.devtools.cloudbuild.v1.PushFilter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GitHubEventsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GitHubEventsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GitHubEventsConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GitHubEventsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.installationId != null && message.hasOwnProperty("installationId")) + if (!$util.isInteger(message.installationId) && !(message.installationId && $util.isInteger(message.installationId.low) && $util.isInteger(message.installationId.high))) + return "installationId: integer|Long expected"; + if (message.owner != null && message.hasOwnProperty("owner")) + if (!$util.isString(message.owner)) + return "owner: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pullRequest != null && message.hasOwnProperty("pullRequest")) { + properties.event = 1; + { + var error = $root.google.devtools.cloudbuild.v1.PullRequestFilter.verify(message.pullRequest); + if (error) + return "pullRequest." + error; + } + } + if (message.push != null && message.hasOwnProperty("push")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.google.devtools.cloudbuild.v1.PushFilter.verify(message.push); + if (error) + return "push." + error; + } + } + return null; + }; + + /** + * Creates a GitHubEventsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.GitHubEventsConfig} GitHubEventsConfig + */ + GitHubEventsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GitHubEventsConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.GitHubEventsConfig(); + if (object.installationId != null) + if ($util.Long) + (message.installationId = $util.Long.fromValue(object.installationId)).unsigned = false; + else if (typeof object.installationId === "string") + message.installationId = parseInt(object.installationId, 10); + else if (typeof object.installationId === "number") + message.installationId = object.installationId; + else if (typeof object.installationId === "object") + message.installationId = new $util.LongBits(object.installationId.low >>> 0, object.installationId.high >>> 0).toNumber(); + if (object.owner != null) + message.owner = String(object.owner); + if (object.name != null) + message.name = String(object.name); + if (object.pullRequest != null) { + if (typeof object.pullRequest !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.GitHubEventsConfig.pullRequest: object expected"); + message.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.fromObject(object.pullRequest); + } + if (object.push != null) { + if (typeof object.push !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.GitHubEventsConfig.push: object expected"); + message.push = $root.google.devtools.cloudbuild.v1.PushFilter.fromObject(object.push); + } + return message; + }; + + /** + * Creates a plain object from a GitHubEventsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {google.devtools.cloudbuild.v1.GitHubEventsConfig} message GitHubEventsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GitHubEventsConfig.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.installationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.installationId = options.longs === String ? "0" : 0; + object.owner = ""; + object.name = ""; + } + if (message.installationId != null && message.hasOwnProperty("installationId")) + if (typeof message.installationId === "number") + object.installationId = options.longs === String ? String(message.installationId) : message.installationId; + else + object.installationId = options.longs === String ? $util.Long.prototype.toString.call(message.installationId) : options.longs === Number ? new $util.LongBits(message.installationId.low >>> 0, message.installationId.high >>> 0).toNumber() : message.installationId; + if (message.pullRequest != null && message.hasOwnProperty("pullRequest")) { + object.pullRequest = $root.google.devtools.cloudbuild.v1.PullRequestFilter.toObject(message.pullRequest, options); + if (options.oneofs) + object.event = "pullRequest"; + } + if (message.push != null && message.hasOwnProperty("push")) { + object.push = $root.google.devtools.cloudbuild.v1.PushFilter.toObject(message.push, options); + if (options.oneofs) + object.event = "push"; + } + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = message.owner; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GitHubEventsConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @instance + * @returns {Object.} JSON object + */ + GitHubEventsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GitHubEventsConfig + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.GitHubEventsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GitHubEventsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.GitHubEventsConfig"; + }; + + return GitHubEventsConfig; + })(); + + v1.PubsubConfig = (function() { + + /** + * Properties of a PubsubConfig. + * @memberof google.devtools.cloudbuild.v1 + * @interface IPubsubConfig + * @property {string|null} [subscription] PubsubConfig subscription + * @property {string|null} [topic] PubsubConfig topic + * @property {string|null} [serviceAccountEmail] PubsubConfig serviceAccountEmail + * @property {google.devtools.cloudbuild.v1.PubsubConfig.State|null} [state] PubsubConfig state + */ + + /** + * Constructs a new PubsubConfig. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a PubsubConfig. + * @implements IPubsubConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.IPubsubConfig=} [properties] Properties to set + */ + function PubsubConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PubsubConfig subscription. + * @member {string} subscription + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @instance + */ + PubsubConfig.prototype.subscription = ""; + + /** + * PubsubConfig topic. + * @member {string} topic + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @instance + */ + PubsubConfig.prototype.topic = ""; + + /** + * PubsubConfig serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @instance + */ + PubsubConfig.prototype.serviceAccountEmail = ""; + + /** + * PubsubConfig state. + * @member {google.devtools.cloudbuild.v1.PubsubConfig.State} state + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @instance + */ + PubsubConfig.prototype.state = 0; + + /** + * Creates a new PubsubConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {google.devtools.cloudbuild.v1.IPubsubConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PubsubConfig} PubsubConfig instance + */ + PubsubConfig.create = function create(properties) { + return new PubsubConfig(properties); + }; + + /** + * Encodes the specified PubsubConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PubsubConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {google.devtools.cloudbuild.v1.IPubsubConfig} message PubsubConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subscription != null && Object.hasOwnProperty.call(message, "subscription")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subscription); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.topic); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountEmail); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified PubsubConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PubsubConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {google.devtools.cloudbuild.v1.IPubsubConfig} message PubsubConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PubsubConfig} PubsubConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PubsubConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subscription = reader.string(); + break; + } + case 2: { + message.topic = reader.string(); + break; + } + case 3: { + message.serviceAccountEmail = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PubsubConfig} PubsubConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subscription != null && message.hasOwnProperty("subscription")) + if (!$util.isString(message.subscription)) + return "subscription: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a PubsubConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PubsubConfig} PubsubConfig + */ + PubsubConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PubsubConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PubsubConfig(); + if (object.subscription != null) + message.subscription = String(object.subscription); + if (object.topic != null) + message.topic = String(object.topic); + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); + 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 "OK": + case 1: + message.state = 1; + break; + case "SUBSCRIPTION_DELETED": + case 2: + message.state = 2; + break; + case "TOPIC_DELETED": + case 3: + message.state = 3; + break; + case "SUBSCRIPTION_MISCONFIGURED": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a PubsubConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {google.devtools.cloudbuild.v1.PubsubConfig} message PubsubConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subscription = ""; + object.topic = ""; + object.serviceAccountEmail = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.subscription != null && message.hasOwnProperty("subscription")) + object.subscription = message.subscription; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.devtools.cloudbuild.v1.PubsubConfig.State[message.state] === undefined ? message.state : $root.google.devtools.cloudbuild.v1.PubsubConfig.State[message.state] : message.state; + return object; + }; + + /** + * Converts this PubsubConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @instance + * @returns {Object.} JSON object + */ + PubsubConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubConfig + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.PubsubConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.PubsubConfig"; + }; + + /** + * State enum. + * @name google.devtools.cloudbuild.v1.PubsubConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} SUBSCRIPTION_DELETED=2 SUBSCRIPTION_DELETED value + * @property {number} TOPIC_DELETED=3 TOPIC_DELETED value + * @property {number} SUBSCRIPTION_MISCONFIGURED=4 SUBSCRIPTION_MISCONFIGURED value + */ + PubsubConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "SUBSCRIPTION_DELETED"] = 2; + values[valuesById[3] = "TOPIC_DELETED"] = 3; + values[valuesById[4] = "SUBSCRIPTION_MISCONFIGURED"] = 4; + return values; + })(); + + return PubsubConfig; + })(); + + v1.WebhookConfig = (function() { + + /** + * Properties of a WebhookConfig. + * @memberof google.devtools.cloudbuild.v1 + * @interface IWebhookConfig + * @property {string|null} [secret] WebhookConfig secret + * @property {google.devtools.cloudbuild.v1.WebhookConfig.State|null} [state] WebhookConfig state + */ + + /** + * Constructs a new WebhookConfig. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a WebhookConfig. + * @implements IWebhookConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.IWebhookConfig=} [properties] Properties to set + */ + function WebhookConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookConfig secret. + * @member {string|null|undefined} secret + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @instance + */ + WebhookConfig.prototype.secret = null; + + /** + * WebhookConfig state. + * @member {google.devtools.cloudbuild.v1.WebhookConfig.State} state + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @instance + */ + WebhookConfig.prototype.state = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WebhookConfig authMethod. + * @member {"secret"|undefined} authMethod + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @instance + */ + Object.defineProperty(WebhookConfig.prototype, "authMethod", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WebhookConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {google.devtools.cloudbuild.v1.IWebhookConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.WebhookConfig} WebhookConfig instance + */ + WebhookConfig.create = function create(properties) { + return new WebhookConfig(properties); + }; + + /** + * Encodes the specified WebhookConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.WebhookConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {google.devtools.cloudbuild.v1.IWebhookConfig} message WebhookConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.secret); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + return writer; + }; + + /** + * Encodes the specified WebhookConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.WebhookConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {google.devtools.cloudbuild.v1.IWebhookConfig} message WebhookConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.WebhookConfig} WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.WebhookConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.secret = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.WebhookConfig} WebhookConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.secret != null && message.hasOwnProperty("secret")) { + properties.authMethod = 1; + if (!$util.isString(message.secret)) + return "secret: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a WebhookConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.WebhookConfig} WebhookConfig + */ + WebhookConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.WebhookConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.WebhookConfig(); + if (object.secret != null) + message.secret = String(object.secret); + 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 "OK": + case 1: + message.state = 1; + break; + case "SECRET_DELETED": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a WebhookConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {google.devtools.cloudbuild.v1.WebhookConfig} message WebhookConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = message.secret; + if (options.oneofs) + object.authMethod = "secret"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.devtools.cloudbuild.v1.WebhookConfig.State[message.state] === undefined ? message.state : $root.google.devtools.cloudbuild.v1.WebhookConfig.State[message.state] : message.state; + return object; + }; + + /** + * Converts this WebhookConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @instance + * @returns {Object.} JSON object + */ + WebhookConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebhookConfig + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.WebhookConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebhookConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.WebhookConfig"; + }; + + /** + * State enum. + * @name google.devtools.cloudbuild.v1.WebhookConfig.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} OK=1 OK value + * @property {number} SECRET_DELETED=2 SECRET_DELETED value + */ + WebhookConfig.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "SECRET_DELETED"] = 2; + return values; + })(); + + return WebhookConfig; + })(); + + v1.PullRequestFilter = (function() { + + /** + * Properties of a PullRequestFilter. + * @memberof google.devtools.cloudbuild.v1 + * @interface IPullRequestFilter + * @property {string|null} [branch] PullRequestFilter branch + * @property {google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|null} [commentControl] PullRequestFilter commentControl + * @property {boolean|null} [invertRegex] PullRequestFilter invertRegex + */ + + /** + * Constructs a new PullRequestFilter. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a PullRequestFilter. + * @implements IPullRequestFilter + * @constructor + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter=} [properties] Properties to set + */ + function PullRequestFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PullRequestFilter branch. + * @member {string|null|undefined} branch + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + */ + PullRequestFilter.prototype.branch = null; + + /** + * PullRequestFilter commentControl. + * @member {google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl} commentControl + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + */ + PullRequestFilter.prototype.commentControl = 0; + + /** + * PullRequestFilter invertRegex. + * @member {boolean} invertRegex + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + */ + PullRequestFilter.prototype.invertRegex = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PullRequestFilter gitRef. + * @member {"branch"|undefined} gitRef + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + */ + Object.defineProperty(PullRequestFilter.prototype, "gitRef", { + get: $util.oneOfGetter($oneOfFields = ["branch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PullRequestFilter instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter instance + */ + PullRequestFilter.create = function create(properties) { + return new PullRequestFilter(properties); + }; + + /** + * Encodes the specified PullRequestFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter} message PullRequestFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequestFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.commentControl != null && Object.hasOwnProperty.call(message, "commentControl")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.commentControl); + if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.invertRegex); + return writer; + }; + + /** + * Encodes the specified PullRequestFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PullRequestFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {google.devtools.cloudbuild.v1.IPullRequestFilter} message PullRequestFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PullRequestFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PullRequestFilter message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequestFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PullRequestFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.branch = reader.string(); + break; + } + case 5: { + message.commentControl = reader.int32(); + break; + } + case 6: { + message.invertRegex = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PullRequestFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PullRequestFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PullRequestFilter message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PullRequestFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.branch != null && message.hasOwnProperty("branch")) { + properties.gitRef = 1; + if (!$util.isString(message.branch)) + return "branch: string expected"; + } + if (message.commentControl != null && message.hasOwnProperty("commentControl")) + switch (message.commentControl) { + default: + return "commentControl: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + if (typeof message.invertRegex !== "boolean") + return "invertRegex: boolean expected"; + return null; + }; + + /** + * Creates a PullRequestFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PullRequestFilter} PullRequestFilter + */ + PullRequestFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PullRequestFilter) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PullRequestFilter(); + if (object.branch != null) + message.branch = String(object.branch); + switch (object.commentControl) { + default: + if (typeof object.commentControl === "number") { + message.commentControl = object.commentControl; + break; + } + break; + case "COMMENTS_DISABLED": + case 0: + message.commentControl = 0; + break; + case "COMMENTS_ENABLED": + case 1: + message.commentControl = 1; + break; + case "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY": + case 2: + message.commentControl = 2; + break; + } + if (object.invertRegex != null) + message.invertRegex = Boolean(object.invertRegex); + return message; + }; + + /** + * Creates a plain object from a PullRequestFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {google.devtools.cloudbuild.v1.PullRequestFilter} message PullRequestFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PullRequestFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.commentControl = options.enums === String ? "COMMENTS_DISABLED" : 0; + object.invertRegex = false; + } + if (message.branch != null && message.hasOwnProperty("branch")) { + object.branch = message.branch; + if (options.oneofs) + object.gitRef = "branch"; + } + if (message.commentControl != null && message.hasOwnProperty("commentControl")) + object.commentControl = options.enums === String ? $root.google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl[message.commentControl] === undefined ? message.commentControl : $root.google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl[message.commentControl] : message.commentControl; + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + object.invertRegex = message.invertRegex; + return object; + }; + + /** + * Converts this PullRequestFilter to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @instance + * @returns {Object.} JSON object + */ + PullRequestFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PullRequestFilter + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.PullRequestFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PullRequestFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.PullRequestFilter"; + }; + + /** + * CommentControl enum. + * @name google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl + * @enum {number} + * @property {number} COMMENTS_DISABLED=0 COMMENTS_DISABLED value + * @property {number} COMMENTS_ENABLED=1 COMMENTS_ENABLED value + * @property {number} COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY=2 COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY value + */ + PullRequestFilter.CommentControl = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMMENTS_DISABLED"] = 0; + values[valuesById[1] = "COMMENTS_ENABLED"] = 1; + values[valuesById[2] = "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY"] = 2; + return values; + })(); + + return PullRequestFilter; + })(); + + v1.PushFilter = (function() { + + /** + * Properties of a PushFilter. + * @memberof google.devtools.cloudbuild.v1 + * @interface IPushFilter + * @property {string|null} [branch] PushFilter branch + * @property {string|null} [tag] PushFilter tag + * @property {boolean|null} [invertRegex] PushFilter invertRegex + */ + + /** + * Constructs a new PushFilter. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a PushFilter. + * @implements IPushFilter + * @constructor + * @param {google.devtools.cloudbuild.v1.IPushFilter=} [properties] Properties to set + */ + function PushFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PushFilter branch. + * @member {string|null|undefined} branch + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @instance + */ + PushFilter.prototype.branch = null; + + /** + * PushFilter tag. + * @member {string|null|undefined} tag + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @instance + */ + PushFilter.prototype.tag = null; + + /** + * PushFilter invertRegex. + * @member {boolean} invertRegex + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @instance + */ + PushFilter.prototype.invertRegex = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PushFilter gitRef. + * @member {"branch"|"tag"|undefined} gitRef + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @instance + */ + Object.defineProperty(PushFilter.prototype, "gitRef", { + get: $util.oneOfGetter($oneOfFields = ["branch", "tag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PushFilter instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {google.devtools.cloudbuild.v1.IPushFilter=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter instance + */ + PushFilter.create = function create(properties) { + return new PushFilter(properties); + }; + + /** + * Encodes the specified PushFilter message. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {google.devtools.cloudbuild.v1.IPushFilter} message PushFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.branch != null && Object.hasOwnProperty.call(message, "branch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.branch); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tag); + if (message.invertRegex != null && Object.hasOwnProperty.call(message, "invertRegex")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.invertRegex); + return writer; + }; + + /** + * Encodes the specified PushFilter message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PushFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {google.devtools.cloudbuild.v1.IPushFilter} message PushFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PushFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PushFilter message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PushFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.branch = reader.string(); + break; + } + case 3: { + message.tag = reader.string(); + break; + } + case 4: { + message.invertRegex = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PushFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PushFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PushFilter message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PushFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.branch != null && message.hasOwnProperty("branch")) { + properties.gitRef = 1; + if (!$util.isString(message.branch)) + return "branch: string expected"; + } + if (message.tag != null && message.hasOwnProperty("tag")) { + if (properties.gitRef === 1) + return "gitRef: multiple values"; + properties.gitRef = 1; + if (!$util.isString(message.tag)) + return "tag: string expected"; + } + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + if (typeof message.invertRegex !== "boolean") + return "invertRegex: boolean expected"; + return null; + }; + + /** + * Creates a PushFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PushFilter} PushFilter + */ + PushFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PushFilter) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PushFilter(); + if (object.branch != null) + message.branch = String(object.branch); + if (object.tag != null) + message.tag = String(object.tag); + if (object.invertRegex != null) + message.invertRegex = Boolean(object.invertRegex); + return message; + }; + + /** + * Creates a plain object from a PushFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {google.devtools.cloudbuild.v1.PushFilter} message PushFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PushFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.invertRegex = false; + if (message.branch != null && message.hasOwnProperty("branch")) { + object.branch = message.branch; + if (options.oneofs) + object.gitRef = "branch"; + } + if (message.tag != null && message.hasOwnProperty("tag")) { + object.tag = message.tag; + if (options.oneofs) + object.gitRef = "tag"; + } + if (message.invertRegex != null && message.hasOwnProperty("invertRegex")) + object.invertRegex = message.invertRegex; + return object; + }; + + /** + * Converts this PushFilter to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @instance + * @returns {Object.} JSON object + */ + PushFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PushFilter + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.PushFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PushFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.PushFilter"; + }; + + return PushFilter; + })(); + + v1.CreateBuildTriggerRequest = (function() { + + /** + * Properties of a CreateBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface ICreateBuildTriggerRequest + * @property {string|null} [parent] CreateBuildTriggerRequest parent + * @property {string|null} [projectId] CreateBuildTriggerRequest projectId + * @property {google.devtools.cloudbuild.v1.IBuildTrigger|null} [trigger] CreateBuildTriggerRequest trigger + */ + + /** + * Constructs a new CreateBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CreateBuildTriggerRequest. + * @implements ICreateBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest=} [properties] Properties to set + */ + function CreateBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBuildTriggerRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @instance + */ + CreateBuildTriggerRequest.prototype.parent = ""; + + /** + * CreateBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @instance + */ + CreateBuildTriggerRequest.prototype.projectId = ""; + + /** + * CreateBuildTriggerRequest trigger. + * @member {google.devtools.cloudbuild.v1.IBuildTrigger|null|undefined} trigger + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @instance + */ + CreateBuildTriggerRequest.prototype.trigger = null; + + /** + * Creates a new CreateBuildTriggerRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest instance + */ + CreateBuildTriggerRequest.create = function create(properties) { + return new CreateBuildTriggerRequest(properties); + }; + + /** + * Encodes the specified CreateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} message CreateBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBuildTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) + $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.trigger, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.parent); + return writer; + }; + + /** + * Encodes the specified CreateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest} message CreateBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBuildTriggerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.parent = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBuildTriggerRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBuildTriggerRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.trigger != null && message.hasOwnProperty("trigger")) { + var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.trigger); + if (error) + return "trigger." + error; + } + return null; + }; + + /** + * Creates a CreateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} CreateBuildTriggerRequest + */ + CreateBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.trigger != null) { + if (typeof object.trigger !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateBuildTriggerRequest.trigger: object expected"); + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.trigger); + } + return message; + }; + + /** + * Creates a plain object from a CreateBuildTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.CreateBuildTriggerRequest} message CreateBuildTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBuildTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.trigger = null; + object.parent = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.trigger, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this CreateBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBuildTriggerRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.CreateBuildTriggerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBuildTriggerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.CreateBuildTriggerRequest"; + }; + + return CreateBuildTriggerRequest; + })(); + + v1.GetBuildTriggerRequest = (function() { + + /** + * Properties of a GetBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IGetBuildTriggerRequest + * @property {string|null} [name] GetBuildTriggerRequest name + * @property {string|null} [projectId] GetBuildTriggerRequest projectId + * @property {string|null} [triggerId] GetBuildTriggerRequest triggerId + */ + + /** + * Constructs a new GetBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a GetBuildTriggerRequest. + * @implements IGetBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest=} [properties] Properties to set + */ + function GetBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBuildTriggerRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @instance + */ + GetBuildTriggerRequest.prototype.name = ""; + + /** + * GetBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @instance + */ + GetBuildTriggerRequest.prototype.projectId = ""; + + /** + * GetBuildTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @instance + */ + GetBuildTriggerRequest.prototype.triggerId = ""; + + /** + * Creates a new GetBuildTriggerRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest instance + */ + GetBuildTriggerRequest.create = function create(properties) { + return new GetBuildTriggerRequest(properties); + }; + + /** + * Encodes the specified GetBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} message GetBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBuildTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetBuildTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetBuildTriggerRequest} message GetBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBuildTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBuildTriggerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.triggerId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBuildTriggerRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBuildTriggerRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + return null; + }; + + /** + * Creates a GetBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} GetBuildTriggerRequest + */ + GetBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.GetBuildTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + return message; + }; + + /** + * Creates a plain object from a GetBuildTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.GetBuildTriggerRequest} message GetBuildTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBuildTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.triggerId = ""; + object.name = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + GetBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBuildTriggerRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.GetBuildTriggerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBuildTriggerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.GetBuildTriggerRequest"; + }; + + return GetBuildTriggerRequest; + })(); + + v1.ListBuildTriggersRequest = (function() { + + /** + * Properties of a ListBuildTriggersRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IListBuildTriggersRequest + * @property {string|null} [parent] ListBuildTriggersRequest parent + * @property {string|null} [projectId] ListBuildTriggersRequest projectId + * @property {number|null} [pageSize] ListBuildTriggersRequest pageSize + * @property {string|null} [pageToken] ListBuildTriggersRequest pageToken + */ + + /** + * Constructs a new ListBuildTriggersRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ListBuildTriggersRequest. + * @implements IListBuildTriggersRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest=} [properties] Properties to set + */ + function ListBuildTriggersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBuildTriggersRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @instance + */ + ListBuildTriggersRequest.prototype.parent = ""; + + /** + * ListBuildTriggersRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @instance + */ + ListBuildTriggersRequest.prototype.projectId = ""; + + /** + * ListBuildTriggersRequest pageSize. + * @member {number} pageSize + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @instance + */ + ListBuildTriggersRequest.prototype.pageSize = 0; + + /** + * ListBuildTriggersRequest pageToken. + * @member {string} pageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @instance + */ + ListBuildTriggersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBuildTriggersRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest instance + */ + ListBuildTriggersRequest.create = function create(properties) { + return new ListBuildTriggersRequest(properties); + }; + + /** + * Encodes the specified ListBuildTriggersRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} message ListBuildTriggersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildTriggersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListBuildTriggersRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersRequest} message ListBuildTriggersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildTriggersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBuildTriggersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildTriggersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.parent = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBuildTriggersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildTriggersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBuildTriggersRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBuildTriggersRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: 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 ListBuildTriggersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} ListBuildTriggersRequest + */ + ListBuildTriggersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.projectId != null) + message.projectId = String(object.projectId); + 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 ListBuildTriggersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {google.devtools.cloudbuild.v1.ListBuildTriggersRequest} message ListBuildTriggersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBuildTriggersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.parent = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListBuildTriggersRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @instance + * @returns {Object.} JSON object + */ + ListBuildTriggersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBuildTriggersRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBuildTriggersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ListBuildTriggersRequest"; + }; + + return ListBuildTriggersRequest; + })(); + + v1.ListBuildTriggersResponse = (function() { + + /** + * Properties of a ListBuildTriggersResponse. + * @memberof google.devtools.cloudbuild.v1 + * @interface IListBuildTriggersResponse + * @property {Array.|null} [triggers] ListBuildTriggersResponse triggers + * @property {string|null} [nextPageToken] ListBuildTriggersResponse nextPageToken + */ + + /** + * Constructs a new ListBuildTriggersResponse. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ListBuildTriggersResponse. + * @implements IListBuildTriggersResponse + * @constructor + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse=} [properties] Properties to set + */ + function ListBuildTriggersResponse(properties) { + this.triggers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBuildTriggersResponse triggers. + * @member {Array.} triggers + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @instance + */ + ListBuildTriggersResponse.prototype.triggers = $util.emptyArray; + + /** + * ListBuildTriggersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @instance + */ + ListBuildTriggersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListBuildTriggersResponse instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse instance + */ + ListBuildTriggersResponse.create = function create(properties) { + return new ListBuildTriggersResponse(properties); + }; + + /** + * Encodes the specified ListBuildTriggersResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse} message ListBuildTriggersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildTriggersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.triggers != null && message.triggers.length) + for (var i = 0; i < message.triggers.length; ++i) + $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.triggers[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 ListBuildTriggersResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListBuildTriggersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListBuildTriggersResponse} message ListBuildTriggersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBuildTriggersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBuildTriggersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildTriggersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.triggers && message.triggers.length)) + message.triggers = []; + message.triggers.push($root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBuildTriggersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBuildTriggersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBuildTriggersResponse message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBuildTriggersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.triggers != null && message.hasOwnProperty("triggers")) { + if (!Array.isArray(message.triggers)) + return "triggers: array expected"; + for (var i = 0; i < message.triggers.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.triggers[i]); + if (error) + return "triggers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListBuildTriggersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} ListBuildTriggersResponse + */ + ListBuildTriggersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListBuildTriggersResponse(); + if (object.triggers) { + if (!Array.isArray(object.triggers)) + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers: array expected"); + message.triggers = []; + for (var i = 0; i < object.triggers.length; ++i) { + if (typeof object.triggers[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ListBuildTriggersResponse.triggers: object expected"); + message.triggers[i] = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.triggers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListBuildTriggersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {google.devtools.cloudbuild.v1.ListBuildTriggersResponse} message ListBuildTriggersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBuildTriggersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.triggers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.triggers && message.triggers.length) { + object.triggers = []; + for (var j = 0; j < message.triggers.length; ++j) + object.triggers[j] = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.triggers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListBuildTriggersResponse to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @instance + * @returns {Object.} JSON object + */ + ListBuildTriggersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBuildTriggersResponse + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ListBuildTriggersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBuildTriggersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ListBuildTriggersResponse"; + }; + + return ListBuildTriggersResponse; + })(); + + v1.DeleteBuildTriggerRequest = (function() { + + /** + * Properties of a DeleteBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IDeleteBuildTriggerRequest + * @property {string|null} [name] DeleteBuildTriggerRequest name + * @property {string|null} [projectId] DeleteBuildTriggerRequest projectId + * @property {string|null} [triggerId] DeleteBuildTriggerRequest triggerId + */ + + /** + * Constructs a new DeleteBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a DeleteBuildTriggerRequest. + * @implements IDeleteBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest=} [properties] Properties to set + */ + function DeleteBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBuildTriggerRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @instance + */ + DeleteBuildTriggerRequest.prototype.name = ""; + + /** + * DeleteBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @instance + */ + DeleteBuildTriggerRequest.prototype.projectId = ""; + + /** + * DeleteBuildTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @instance + */ + DeleteBuildTriggerRequest.prototype.triggerId = ""; + + /** + * Creates a new DeleteBuildTriggerRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest instance + */ + DeleteBuildTriggerRequest.create = function create(properties) { + return new DeleteBuildTriggerRequest(properties); + }; + + /** + * Encodes the specified DeleteBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} message DeleteBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBuildTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest} message DeleteBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBuildTriggerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.triggerId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBuildTriggerRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBuildTriggerRequest.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + return null; + }; + + /** + * Creates a DeleteBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} DeleteBuildTriggerRequest + */ + DeleteBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + return message; + }; + + /** + * Creates a plain object from a DeleteBuildTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest} message DeleteBuildTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBuildTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.triggerId = ""; + object.name = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBuildTriggerRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBuildTriggerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest"; + }; + + return DeleteBuildTriggerRequest; + })(); + + v1.UpdateBuildTriggerRequest = (function() { + + /** + * Properties of an UpdateBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IUpdateBuildTriggerRequest + * @property {string|null} [projectId] UpdateBuildTriggerRequest projectId + * @property {string|null} [triggerId] UpdateBuildTriggerRequest triggerId + * @property {google.devtools.cloudbuild.v1.IBuildTrigger|null} [trigger] UpdateBuildTriggerRequest trigger + */ + + /** + * Constructs a new UpdateBuildTriggerRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an UpdateBuildTriggerRequest. + * @implements IUpdateBuildTriggerRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest=} [properties] Properties to set + */ + function UpdateBuildTriggerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBuildTriggerRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + */ + UpdateBuildTriggerRequest.prototype.projectId = ""; + + /** + * UpdateBuildTriggerRequest triggerId. + * @member {string} triggerId + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + */ + UpdateBuildTriggerRequest.prototype.triggerId = ""; + + /** + * UpdateBuildTriggerRequest trigger. + * @member {google.devtools.cloudbuild.v1.IBuildTrigger|null|undefined} trigger + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + */ + UpdateBuildTriggerRequest.prototype.trigger = null; + + /** + * Creates a new UpdateBuildTriggerRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest instance + */ + UpdateBuildTriggerRequest.create = function create(properties) { + return new UpdateBuildTriggerRequest(properties); + }; + + /** + * Encodes the specified UpdateBuildTriggerRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} message UpdateBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBuildTriggerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.triggerId); + if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) + $root.google.devtools.cloudbuild.v1.BuildTrigger.encode(message.trigger, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBuildTriggerRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest} message UpdateBuildTriggerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBuildTriggerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBuildTriggerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.triggerId = reader.string(); + break; + } + case 3: { + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBuildTriggerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBuildTriggerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBuildTriggerRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBuildTriggerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + if (message.trigger != null && message.hasOwnProperty("trigger")) { + var error = $root.google.devtools.cloudbuild.v1.BuildTrigger.verify(message.trigger); + if (error) + return "trigger." + error; + } + return null; + }; + + /** + * Creates an UpdateBuildTriggerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} UpdateBuildTriggerRequest + */ + UpdateBuildTriggerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + if (object.trigger != null) { + if (typeof object.trigger !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest.trigger: object expected"); + message.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.fromObject(object.trigger); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBuildTriggerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest} message UpdateBuildTriggerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBuildTriggerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.triggerId = ""; + object.trigger = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = $root.google.devtools.cloudbuild.v1.BuildTrigger.toObject(message.trigger, options); + return object; + }; + + /** + * Converts this UpdateBuildTriggerRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBuildTriggerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBuildTriggerRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBuildTriggerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest"; + }; + + return UpdateBuildTriggerRequest; + })(); + + v1.BuildOptions = (function() { + + /** + * Properties of a BuildOptions. + * @memberof google.devtools.cloudbuild.v1 + * @interface IBuildOptions + * @property {Array.|null} [sourceProvenanceHash] BuildOptions sourceProvenanceHash + * @property {google.devtools.cloudbuild.v1.BuildOptions.VerifyOption|null} [requestedVerifyOption] BuildOptions requestedVerifyOption + * @property {google.devtools.cloudbuild.v1.BuildOptions.MachineType|null} [machineType] BuildOptions machineType + * @property {number|Long|null} [diskSizeGb] BuildOptions diskSizeGb + * @property {google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption|null} [substitutionOption] BuildOptions substitutionOption + * @property {boolean|null} [dynamicSubstitutions] BuildOptions dynamicSubstitutions + * @property {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|null} [logStreamingOption] BuildOptions logStreamingOption + * @property {string|null} [workerPool] BuildOptions workerPool + * @property {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null} [pool] BuildOptions pool + * @property {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|null} [logging] BuildOptions logging + * @property {Array.|null} [env] BuildOptions env + * @property {Array.|null} [secretEnv] BuildOptions secretEnv + * @property {Array.|null} [volumes] BuildOptions volumes + */ + + /** + * Constructs a new BuildOptions. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a BuildOptions. + * @implements IBuildOptions + * @constructor + * @param {google.devtools.cloudbuild.v1.IBuildOptions=} [properties] Properties to set + */ + function BuildOptions(properties) { + this.sourceProvenanceHash = []; + this.env = []; + this.secretEnv = []; + this.volumes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildOptions sourceProvenanceHash. + * @member {Array.} sourceProvenanceHash + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.sourceProvenanceHash = $util.emptyArray; + + /** + * BuildOptions requestedVerifyOption. + * @member {google.devtools.cloudbuild.v1.BuildOptions.VerifyOption} requestedVerifyOption + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.requestedVerifyOption = 0; + + /** + * BuildOptions machineType. + * @member {google.devtools.cloudbuild.v1.BuildOptions.MachineType} machineType + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.machineType = 0; + + /** + * BuildOptions diskSizeGb. + * @member {number|Long} diskSizeGb + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.diskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BuildOptions substitutionOption. + * @member {google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption} substitutionOption + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.substitutionOption = 0; + + /** + * BuildOptions dynamicSubstitutions. + * @member {boolean} dynamicSubstitutions + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.dynamicSubstitutions = false; + + /** + * BuildOptions logStreamingOption. + * @member {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption} logStreamingOption + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.logStreamingOption = 0; + + /** + * BuildOptions workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.workerPool = ""; + + /** + * BuildOptions pool. + * @member {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null|undefined} pool + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.pool = null; + + /** + * BuildOptions logging. + * @member {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode} logging + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.logging = 0; + + /** + * BuildOptions env. + * @member {Array.} env + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.env = $util.emptyArray; + + /** + * BuildOptions secretEnv. + * @member {Array.} secretEnv + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.secretEnv = $util.emptyArray; + + /** + * BuildOptions volumes. + * @member {Array.} volumes + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.volumes = $util.emptyArray; + + /** + * Creates a new BuildOptions instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOptions=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions instance + */ + BuildOptions.create = function create(properties) { + return new BuildOptions(properties); + }; + + /** + * Encodes the specified BuildOptions message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOptions} message BuildOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceProvenanceHash != null && message.sourceProvenanceHash.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.sourceProvenanceHash.length; ++i) + writer.int32(message.sourceProvenanceHash[i]); + writer.ldelim(); + } + if (message.requestedVerifyOption != null && Object.hasOwnProperty.call(message, "requestedVerifyOption")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.requestedVerifyOption); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.machineType); + if (message.substitutionOption != null && Object.hasOwnProperty.call(message, "substitutionOption")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.substitutionOption); + if (message.logStreamingOption != null && Object.hasOwnProperty.call(message, "logStreamingOption")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.logStreamingOption); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.diskSizeGb); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.workerPool); + if (message.logging != null && Object.hasOwnProperty.call(message, "logging")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.logging); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.env[i]); + if (message.secretEnv != null && message.secretEnv.length) + for (var i = 0; i < message.secretEnv.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.secretEnv[i]); + if (message.volumes != null && message.volumes.length) + for (var i = 0; i < message.volumes.length; ++i) + $root.google.devtools.cloudbuild.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.dynamicSubstitutions != null && Object.hasOwnProperty.call(message, "dynamicSubstitutions")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.dynamicSubstitutions); + if (message.pool != null && Object.hasOwnProperty.call(message, "pool")) + $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.encode(message.pool, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BuildOptions message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.IBuildOptions} message BuildOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildOptions message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sourceProvenanceHash && message.sourceProvenanceHash.length)) + message.sourceProvenanceHash = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sourceProvenanceHash.push(reader.int32()); + } else + message.sourceProvenanceHash.push(reader.int32()); + break; + } + case 2: { + message.requestedVerifyOption = reader.int32(); + break; + } + case 3: { + message.machineType = reader.int32(); + break; + } + case 6: { + message.diskSizeGb = reader.int64(); + break; + } + case 4: { + message.substitutionOption = reader.int32(); + break; + } + case 17: { + message.dynamicSubstitutions = reader.bool(); + break; + } + case 5: { + message.logStreamingOption = reader.int32(); + break; + } + case 7: { + message.workerPool = reader.string(); + break; + } + case 19: { + message.pool = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.decode(reader, reader.uint32()); + break; + } + case 11: { + message.logging = reader.int32(); + break; + } + case 12: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push(reader.string()); + break; + } + case 13: { + if (!(message.secretEnv && message.secretEnv.length)) + message.secretEnv = []; + message.secretEnv.push(reader.string()); + break; + } + case 14: { + if (!(message.volumes && message.volumes.length)) + message.volumes = []; + message.volumes.push($root.google.devtools.cloudbuild.v1.Volume.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildOptions message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourceProvenanceHash != null && message.hasOwnProperty("sourceProvenanceHash")) { + if (!Array.isArray(message.sourceProvenanceHash)) + return "sourceProvenanceHash: array expected"; + for (var i = 0; i < message.sourceProvenanceHash.length; ++i) + switch (message.sourceProvenanceHash[i]) { + default: + return "sourceProvenanceHash: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.requestedVerifyOption != null && message.hasOwnProperty("requestedVerifyOption")) + switch (message.requestedVerifyOption) { + default: + return "requestedVerifyOption: enum value expected"; + case 0: + case 1: + break; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + switch (message.machineType) { + default: + return "machineType: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 6: + break; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + if (message.substitutionOption != null && message.hasOwnProperty("substitutionOption")) + switch (message.substitutionOption) { + default: + return "substitutionOption: enum value expected"; + case 0: + case 1: + break; + } + if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) + if (typeof message.dynamicSubstitutions !== "boolean") + return "dynamicSubstitutions: boolean expected"; + if (message.logStreamingOption != null && message.hasOwnProperty("logStreamingOption")) + switch (message.logStreamingOption) { + default: + return "logStreamingOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.pool != null && message.hasOwnProperty("pool")) { + var error = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify(message.pool); + if (error) + return "pool." + error; + } + if (message.logging != null && message.hasOwnProperty("logging")) + switch (message.logging) { + default: + return "logging: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) + if (!$util.isString(message.env[i])) + return "env: string[] expected"; + } + if (message.secretEnv != null && message.hasOwnProperty("secretEnv")) { + if (!Array.isArray(message.secretEnv)) + return "secretEnv: array expected"; + for (var i = 0; i < message.secretEnv.length; ++i) + if (!$util.isString(message.secretEnv[i])) + return "secretEnv: string[] expected"; + } + if (message.volumes != null && message.hasOwnProperty("volumes")) { + if (!Array.isArray(message.volumes)) + return "volumes: array expected"; + for (var i = 0; i < message.volumes.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.Volume.verify(message.volumes[i]); + if (error) + return "volumes." + error; + } + } + return null; + }; + + /** + * Creates a BuildOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildOptions} BuildOptions + */ + BuildOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildOptions) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildOptions(); + if (object.sourceProvenanceHash) { + if (!Array.isArray(object.sourceProvenanceHash)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.sourceProvenanceHash: array expected"); + message.sourceProvenanceHash = []; + for (var i = 0; i < object.sourceProvenanceHash.length; ++i) + switch (object.sourceProvenanceHash[i]) { + default: + if (typeof object.sourceProvenanceHash[i] === "number") { + message.sourceProvenanceHash[i] = object.sourceProvenanceHash[i]; + break; + } + case "NONE": + case 0: + message.sourceProvenanceHash[i] = 0; + break; + case "SHA256": + case 1: + message.sourceProvenanceHash[i] = 1; + break; + case "MD5": + case 2: + message.sourceProvenanceHash[i] = 2; + break; + } + } + switch (object.requestedVerifyOption) { + default: + if (typeof object.requestedVerifyOption === "number") { + message.requestedVerifyOption = object.requestedVerifyOption; + break; + } + break; + case "NOT_VERIFIED": + case 0: + message.requestedVerifyOption = 0; + break; + case "VERIFIED": + case 1: + message.requestedVerifyOption = 1; + break; + } + switch (object.machineType) { + default: + if (typeof object.machineType === "number") { + message.machineType = object.machineType; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.machineType = 0; + break; + case "N1_HIGHCPU_8": + case 1: + message.machineType = 1; + break; + case "N1_HIGHCPU_32": + case 2: + message.machineType = 2; + break; + case "E2_HIGHCPU_8": + case 5: + message.machineType = 5; + break; + case "E2_HIGHCPU_32": + case 6: + message.machineType = 6; + break; + } + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + switch (object.substitutionOption) { + default: + if (typeof object.substitutionOption === "number") { + message.substitutionOption = object.substitutionOption; + break; + } + break; + case "MUST_MATCH": + case 0: + message.substitutionOption = 0; + break; + case "ALLOW_LOOSE": + case 1: + message.substitutionOption = 1; + break; + } + if (object.dynamicSubstitutions != null) + message.dynamicSubstitutions = Boolean(object.dynamicSubstitutions); + switch (object.logStreamingOption) { + default: + if (typeof object.logStreamingOption === "number") { + message.logStreamingOption = object.logStreamingOption; + break; + } + break; + case "STREAM_DEFAULT": + case 0: + message.logStreamingOption = 0; + break; + case "STREAM_ON": + case 1: + message.logStreamingOption = 1; + break; + case "STREAM_OFF": + case 2: + message.logStreamingOption = 2; + break; + } + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.pool != null) { + if (typeof object.pool !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.pool: object expected"); + message.pool = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.fromObject(object.pool); + } + switch (object.logging) { + default: + if (typeof object.logging === "number") { + message.logging = object.logging; + break; + } + break; + case "LOGGING_UNSPECIFIED": + case 0: + message.logging = 0; + break; + case "LEGACY": + case 1: + message.logging = 1; + break; + case "GCS_ONLY": + case 2: + message.logging = 2; + break; + case "STACKDRIVER_ONLY": + case 3: + message.logging = 3; + break; + case "CLOUD_LOGGING_ONLY": + case 5: + message.logging = 5; + break; + case "NONE": + case 4: + message.logging = 4; + break; + } + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) + message.env[i] = String(object.env[i]); + } + if (object.secretEnv) { + if (!Array.isArray(object.secretEnv)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.secretEnv: array expected"); + message.secretEnv = []; + for (var i = 0; i < object.secretEnv.length; ++i) + message.secretEnv[i] = String(object.secretEnv[i]); + } + if (object.volumes) { + if (!Array.isArray(object.volumes)) + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.volumes: array expected"); + message.volumes = []; + for (var i = 0; i < object.volumes.length; ++i) { + if (typeof object.volumes[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.volumes: object expected"); + message.volumes[i] = $root.google.devtools.cloudbuild.v1.Volume.fromObject(object.volumes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BuildOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions} message BuildOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sourceProvenanceHash = []; + object.env = []; + object.secretEnv = []; + object.volumes = []; + } + if (options.defaults) { + object.requestedVerifyOption = options.enums === String ? "NOT_VERIFIED" : 0; + object.machineType = options.enums === String ? "UNSPECIFIED" : 0; + object.substitutionOption = options.enums === String ? "MUST_MATCH" : 0; + object.logStreamingOption = options.enums === String ? "STREAM_DEFAULT" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskSizeGb = options.longs === String ? "0" : 0; + object.workerPool = ""; + object.logging = options.enums === String ? "LOGGING_UNSPECIFIED" : 0; + object.dynamicSubstitutions = false; + object.pool = null; + } + if (message.sourceProvenanceHash && message.sourceProvenanceHash.length) { + object.sourceProvenanceHash = []; + for (var j = 0; j < message.sourceProvenanceHash.length; ++j) + object.sourceProvenanceHash[j] = options.enums === String ? $root.google.devtools.cloudbuild.v1.Hash.HashType[message.sourceProvenanceHash[j]] === undefined ? message.sourceProvenanceHash[j] : $root.google.devtools.cloudbuild.v1.Hash.HashType[message.sourceProvenanceHash[j]] : message.sourceProvenanceHash[j]; + } + if (message.requestedVerifyOption != null && message.hasOwnProperty("requestedVerifyOption")) + object.requestedVerifyOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.VerifyOption[message.requestedVerifyOption] === undefined ? message.requestedVerifyOption : $root.google.devtools.cloudbuild.v1.BuildOptions.VerifyOption[message.requestedVerifyOption] : message.requestedVerifyOption; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.MachineType[message.machineType] === undefined ? message.machineType : $root.google.devtools.cloudbuild.v1.BuildOptions.MachineType[message.machineType] : message.machineType; + if (message.substitutionOption != null && message.hasOwnProperty("substitutionOption")) + object.substitutionOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption[message.substitutionOption] === undefined ? message.substitutionOption : $root.google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption[message.substitutionOption] : message.substitutionOption; + if (message.logStreamingOption != null && message.hasOwnProperty("logStreamingOption")) + object.logStreamingOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption[message.logStreamingOption] === undefined ? message.logStreamingOption : $root.google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption[message.logStreamingOption] : message.logStreamingOption; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.logging != null && message.hasOwnProperty("logging")) + object.logging = options.enums === String ? $root.google.devtools.cloudbuild.v1.BuildOptions.LoggingMode[message.logging] === undefined ? message.logging : $root.google.devtools.cloudbuild.v1.BuildOptions.LoggingMode[message.logging] : message.logging; + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = message.env[j]; + } + if (message.secretEnv && message.secretEnv.length) { + object.secretEnv = []; + for (var j = 0; j < message.secretEnv.length; ++j) + object.secretEnv[j] = message.secretEnv[j]; + } + if (message.volumes && message.volumes.length) { + object.volumes = []; + for (var j = 0; j < message.volumes.length; ++j) + object.volumes[j] = $root.google.devtools.cloudbuild.v1.Volume.toObject(message.volumes[j], options); + } + if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) + object.dynamicSubstitutions = message.dynamicSubstitutions; + if (message.pool != null && message.hasOwnProperty("pool")) + object.pool = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.toObject(message.pool, options); + return object; + }; + + /** + * Converts this BuildOptions to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + * @returns {Object.} JSON object + */ + BuildOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BuildOptions + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BuildOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuildOptions"; + }; + + BuildOptions.PoolOption = (function() { + + /** + * Properties of a PoolOption. + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @interface IPoolOption + * @property {string|null} [name] PoolOption name + */ + + /** + * Constructs a new PoolOption. + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @classdesc Represents a PoolOption. + * @implements IPoolOption + * @constructor + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption=} [properties] Properties to set + */ + function PoolOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PoolOption name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @instance + */ + PoolOption.prototype.name = ""; + + /** + * Creates a new PoolOption instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption instance + */ + PoolOption.create = function create(properties) { + return new PoolOption(properties); + }; + + /** + * Encodes the specified PoolOption message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption} message PoolOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PoolOption.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 PoolOption message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption} message PoolOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PoolOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PoolOption message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PoolOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption(); + 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 PoolOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PoolOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PoolOption message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PoolOption.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 PoolOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption + */ + PoolOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PoolOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} message PoolOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PoolOption.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 PoolOption to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @instance + * @returns {Object.} JSON object + */ + PoolOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PoolOption + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PoolOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.BuildOptions.PoolOption"; + }; + + return PoolOption; + })(); + + /** + * VerifyOption enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.VerifyOption + * @enum {number} + * @property {number} NOT_VERIFIED=0 NOT_VERIFIED value + * @property {number} VERIFIED=1 VERIFIED value + */ + BuildOptions.VerifyOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOT_VERIFIED"] = 0; + values[valuesById[1] = "VERIFIED"] = 1; + return values; + })(); + + /** + * MachineType enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.MachineType + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} N1_HIGHCPU_8=1 N1_HIGHCPU_8 value + * @property {number} N1_HIGHCPU_32=2 N1_HIGHCPU_32 value + * @property {number} E2_HIGHCPU_8=5 E2_HIGHCPU_8 value + * @property {number} E2_HIGHCPU_32=6 E2_HIGHCPU_32 value + */ + BuildOptions.MachineType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "N1_HIGHCPU_8"] = 1; + values[valuesById[2] = "N1_HIGHCPU_32"] = 2; + values[valuesById[5] = "E2_HIGHCPU_8"] = 5; + values[valuesById[6] = "E2_HIGHCPU_32"] = 6; + return values; + })(); + + /** + * SubstitutionOption enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption + * @enum {number} + * @property {number} MUST_MATCH=0 MUST_MATCH value + * @property {number} ALLOW_LOOSE=1 ALLOW_LOOSE value + */ + BuildOptions.SubstitutionOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUST_MATCH"] = 0; + values[valuesById[1] = "ALLOW_LOOSE"] = 1; + return values; + })(); + + /** + * LogStreamingOption enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption + * @enum {number} + * @property {number} STREAM_DEFAULT=0 STREAM_DEFAULT value + * @property {number} STREAM_ON=1 STREAM_ON value + * @property {number} STREAM_OFF=2 STREAM_OFF value + */ + BuildOptions.LogStreamingOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STREAM_DEFAULT"] = 0; + values[valuesById[1] = "STREAM_ON"] = 1; + values[valuesById[2] = "STREAM_OFF"] = 2; + return values; + })(); + + /** + * LoggingMode enum. + * @name google.devtools.cloudbuild.v1.BuildOptions.LoggingMode + * @enum {number} + * @property {number} LOGGING_UNSPECIFIED=0 LOGGING_UNSPECIFIED value + * @property {number} LEGACY=1 LEGACY value + * @property {number} GCS_ONLY=2 GCS_ONLY value + * @property {number} STACKDRIVER_ONLY=3 STACKDRIVER_ONLY value + * @property {number} CLOUD_LOGGING_ONLY=5 CLOUD_LOGGING_ONLY value + * @property {number} NONE=4 NONE value + */ + BuildOptions.LoggingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOGGING_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEGACY"] = 1; + values[valuesById[2] = "GCS_ONLY"] = 2; + values[valuesById[3] = "STACKDRIVER_ONLY"] = 3; + values[valuesById[5] = "CLOUD_LOGGING_ONLY"] = 5; + values[valuesById[4] = "NONE"] = 4; + return values; + })(); + + return BuildOptions; + })(); + + v1.ReceiveTriggerWebhookRequest = (function() { + + /** + * Properties of a ReceiveTriggerWebhookRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IReceiveTriggerWebhookRequest + * @property {string|null} [name] ReceiveTriggerWebhookRequest name + * @property {google.api.IHttpBody|null} [body] ReceiveTriggerWebhookRequest body + * @property {string|null} [projectId] ReceiveTriggerWebhookRequest projectId + * @property {string|null} [trigger] ReceiveTriggerWebhookRequest trigger + * @property {string|null} [secret] ReceiveTriggerWebhookRequest secret + */ + + /** + * Constructs a new ReceiveTriggerWebhookRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ReceiveTriggerWebhookRequest. + * @implements IReceiveTriggerWebhookRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest=} [properties] Properties to set + */ + function ReceiveTriggerWebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReceiveTriggerWebhookRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.name = ""; + + /** + * ReceiveTriggerWebhookRequest body. + * @member {google.api.IHttpBody|null|undefined} body + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.body = null; + + /** + * ReceiveTriggerWebhookRequest projectId. + * @member {string} projectId + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.projectId = ""; + + /** + * ReceiveTriggerWebhookRequest trigger. + * @member {string} trigger + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.trigger = ""; + + /** + * ReceiveTriggerWebhookRequest secret. + * @member {string} secret + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + */ + ReceiveTriggerWebhookRequest.prototype.secret = ""; + + /** + * Creates a new ReceiveTriggerWebhookRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest instance + */ + ReceiveTriggerWebhookRequest.create = function create(properties) { + return new ReceiveTriggerWebhookRequest(properties); + }; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} message ReceiveTriggerWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.google.api.HttpBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.trigger != null && Object.hasOwnProperty.call(message, "trigger")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.trigger); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.secret); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.name); + return writer; + }; + + /** + * Encodes the specified ReceiveTriggerWebhookRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest} message ReceiveTriggerWebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.name = reader.string(); + break; + } + case 1: { + message.body = $root.google.api.HttpBody.decode(reader, reader.uint32()); + break; + } + case 2: { + message.projectId = reader.string(); + break; + } + case 3: { + message.trigger = reader.string(); + break; + } + case 4: { + message.secret = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReceiveTriggerWebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceiveTriggerWebhookRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceiveTriggerWebhookRequest.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.body != null && message.hasOwnProperty("body")) { + var error = $root.google.api.HttpBody.verify(message.body); + if (error) + return "body." + error; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.trigger != null && message.hasOwnProperty("trigger")) + if (!$util.isString(message.trigger)) + return "trigger: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!$util.isString(message.secret)) + return "secret: string expected"; + return null; + }; + + /** + * Creates a ReceiveTriggerWebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} ReceiveTriggerWebhookRequest + */ + ReceiveTriggerWebhookRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest.body: object expected"); + message.body = $root.google.api.HttpBody.fromObject(object.body); + } + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.trigger != null) + message.trigger = String(object.trigger); + if (object.secret != null) + message.secret = String(object.secret); + return message; + }; + + /** + * Creates a plain object from a ReceiveTriggerWebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest} message ReceiveTriggerWebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceiveTriggerWebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.body = null; + object.projectId = ""; + object.trigger = ""; + object.secret = ""; + object.name = ""; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.google.api.HttpBody.toObject(message.body, options); + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.trigger != null && message.hasOwnProperty("trigger")) + object.trigger = message.trigger; + if (message.secret != null && message.hasOwnProperty("secret")) + object.secret = message.secret; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ReceiveTriggerWebhookRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @instance + * @returns {Object.} JSON object + */ + ReceiveTriggerWebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceiveTriggerWebhookRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceiveTriggerWebhookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest"; + }; + + return ReceiveTriggerWebhookRequest; + })(); + + v1.ReceiveTriggerWebhookResponse = (function() { + + /** + * Properties of a ReceiveTriggerWebhookResponse. + * @memberof google.devtools.cloudbuild.v1 + * @interface IReceiveTriggerWebhookResponse + */ + + /** + * Constructs a new ReceiveTriggerWebhookResponse. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ReceiveTriggerWebhookResponse. + * @implements IReceiveTriggerWebhookResponse + * @constructor + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse=} [properties] Properties to set + */ + function ReceiveTriggerWebhookResponse(properties) { + if (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 ReceiveTriggerWebhookResponse instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse instance + */ + ReceiveTriggerWebhookResponse.create = function create(properties) { + return new ReceiveTriggerWebhookResponse(properties); + }; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse} message ReceiveTriggerWebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ReceiveTriggerWebhookResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse} message ReceiveTriggerWebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReceiveTriggerWebhookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReceiveTriggerWebhookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReceiveTriggerWebhookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReceiveTriggerWebhookResponse message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReceiveTriggerWebhookResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ReceiveTriggerWebhookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} ReceiveTriggerWebhookResponse + */ + ReceiveTriggerWebhookResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse) + return object; + return new $root.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse(); + }; + + /** + * Creates a plain object from a ReceiveTriggerWebhookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse} message ReceiveTriggerWebhookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReceiveTriggerWebhookResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ReceiveTriggerWebhookResponse to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @instance + * @returns {Object.} JSON object + */ + ReceiveTriggerWebhookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReceiveTriggerWebhookResponse + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReceiveTriggerWebhookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse"; + }; + + return ReceiveTriggerWebhookResponse; + })(); + + v1.WorkerPool = (function() { + + /** + * Properties of a WorkerPool. + * @memberof google.devtools.cloudbuild.v1 + * @interface IWorkerPool + * @property {string|null} [name] WorkerPool name + * @property {string|null} [displayName] WorkerPool displayName + * @property {string|null} [uid] WorkerPool uid + * @property {Object.|null} [annotations] WorkerPool annotations + * @property {google.protobuf.ITimestamp|null} [createTime] WorkerPool createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] WorkerPool updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkerPool deleteTime + * @property {google.devtools.cloudbuild.v1.WorkerPool.State|null} [state] WorkerPool state + * @property {google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null} [privatePoolV1Config] WorkerPool privatePoolV1Config + * @property {string|null} [etag] WorkerPool etag + */ + + /** + * Constructs a new WorkerPool. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a WorkerPool. + * @implements IWorkerPool + * @constructor + * @param {google.devtools.cloudbuild.v1.IWorkerPool=} [properties] Properties to set + */ + function WorkerPool(properties) { + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerPool name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.name = ""; + + /** + * WorkerPool displayName. + * @member {string} displayName + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.displayName = ""; + + /** + * WorkerPool uid. + * @member {string} uid + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.uid = ""; + + /** + * WorkerPool annotations. + * @member {Object.} annotations + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.annotations = $util.emptyObject; + + /** + * WorkerPool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.createTime = null; + + /** + * WorkerPool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.updateTime = null; + + /** + * WorkerPool deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.deleteTime = null; + + /** + * WorkerPool state. + * @member {google.devtools.cloudbuild.v1.WorkerPool.State} state + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.state = 0; + + /** + * WorkerPool privatePoolV1Config. + * @member {google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null|undefined} privatePoolV1Config + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.privatePoolV1Config = null; + + /** + * WorkerPool etag. + * @member {string} etag + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WorkerPool config. + * @member {"privatePoolV1Config"|undefined} config + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + Object.defineProperty(WorkerPool.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["privatePoolV1Config"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WorkerPool instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {google.devtools.cloudbuild.v1.IWorkerPool=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.WorkerPool} WorkerPool instance + */ + WorkerPool.create = function create(properties) { + return new WorkerPool(properties); + }; + + /** + * Encodes the specified WorkerPool message. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerPool.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {google.devtools.cloudbuild.v1.IWorkerPool} message WorkerPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), 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.annotations[keys[i]]).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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.privatePoolV1Config != null && Object.hasOwnProperty.call(message, "privatePoolV1Config")) + $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.encode(message.privatePoolV1Config, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkerPool message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {google.devtools.cloudbuild.v1.IWorkerPool} message WorkerPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerPool message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.WorkerPool} WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.WorkerPool(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 12: { + message.privatePoolV1Config = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.WorkerPool} WorkerPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerPool message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerPool.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + 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: + case 4: + break; + } + if (message.privatePoolV1Config != null && message.hasOwnProperty("privatePoolV1Config")) { + properties.config = 1; + { + var error = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify(message.privatePoolV1Config); + if (error) + return "privatePoolV1Config." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a WorkerPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.WorkerPool} WorkerPool + */ + WorkerPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.WorkerPool) + return object; + var message = new $root.google.devtools.cloudbuild.v1.WorkerPool(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + 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 "CREATING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "DELETED": + case 4: + message.state = 4; + break; + } + if (object.privatePoolV1Config != null) { + if (typeof object.privatePoolV1Config !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.privatePoolV1Config: object expected"); + message.privatePoolV1Config = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.fromObject(object.privatePoolV1Config); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a WorkerPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {google.devtools.cloudbuild.v1.WorkerPool} message WorkerPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.devtools.cloudbuild.v1.WorkerPool.State[message.state] === undefined ? message.state : $root.google.devtools.cloudbuild.v1.WorkerPool.State[message.state] : message.state; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.privatePoolV1Config != null && message.hasOwnProperty("privatePoolV1Config")) { + object.privatePoolV1Config = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.toObject(message.privatePoolV1Config, options); + if (options.oneofs) + object.config = "privatePoolV1Config"; + } + return object; + }; + + /** + * Converts this WorkerPool to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + * @returns {Object.} JSON object + */ + WorkerPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerPool + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.WorkerPool"; + }; + + /** + * State enum. + * @name google.devtools.cloudbuild.v1.WorkerPool.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DELETING=3 DELETING value + * @property {number} DELETED=4 DELETED value + */ + WorkerPool.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return WorkerPool; + })(); + + v1.PrivatePoolV1Config = (function() { + + /** + * Properties of a PrivatePoolV1Config. + * @memberof google.devtools.cloudbuild.v1 + * @interface IPrivatePoolV1Config + * @property {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null} [workerConfig] PrivatePoolV1Config workerConfig + * @property {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null} [networkConfig] PrivatePoolV1Config networkConfig + */ + + /** + * Constructs a new PrivatePoolV1Config. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a PrivatePoolV1Config. + * @implements IPrivatePoolV1Config + * @constructor + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config=} [properties] Properties to set + */ + function PrivatePoolV1Config(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivatePoolV1Config workerConfig. + * @member {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null|undefined} workerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @instance + */ + PrivatePoolV1Config.prototype.workerConfig = null; + + /** + * PrivatePoolV1Config networkConfig. + * @member {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null|undefined} networkConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @instance + */ + PrivatePoolV1Config.prototype.networkConfig = null; + + /** + * Creates a new PrivatePoolV1Config instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config instance + */ + PrivatePoolV1Config.create = function create(properties) { + return new PrivatePoolV1Config(properties); + }; + + /** + * Encodes the specified PrivatePoolV1Config message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config} message PrivatePoolV1Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePoolV1Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) + $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.encode(message.workerConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrivatePoolV1Config message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config} message PrivatePoolV1Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivatePoolV1Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivatePoolV1Config message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePoolV1Config.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.networkConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivatePoolV1Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivatePoolV1Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivatePoolV1Config message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivatePoolV1Config.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { + var error = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify(message.workerConfig); + if (error) + return "workerConfig." + error; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + return null; + }; + + /** + * Creates a PrivatePoolV1Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config + */ + PrivatePoolV1Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config(); + if (object.workerConfig != null) { + if (typeof object.workerConfig !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.PrivatePoolV1Config.workerConfig: object expected"); + message.workerConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.fromObject(object.workerConfig); + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.PrivatePoolV1Config.networkConfig: object expected"); + message.networkConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.fromObject(object.networkConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrivatePoolV1Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config} message PrivatePoolV1Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivatePoolV1Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerConfig = null; + object.networkConfig = null; + } + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) + object.workerConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.toObject(message.workerConfig, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.toObject(message.networkConfig, options); + return object; + }; + + /** + * Converts this PrivatePoolV1Config to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @instance + * @returns {Object.} JSON object + */ + PrivatePoolV1Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivatePoolV1Config + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivatePoolV1Config.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.PrivatePoolV1Config"; + }; + + PrivatePoolV1Config.WorkerConfig = (function() { + + /** + * Properties of a WorkerConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @interface IWorkerConfig + * @property {string|null} [machineType] WorkerConfig machineType + * @property {number|Long|null} [diskSizeGb] WorkerConfig diskSizeGb + */ + + /** + * Constructs a new WorkerConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @classdesc Represents a WorkerConfig. + * @implements IWorkerConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig=} [properties] Properties to set + */ + function WorkerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkerConfig machineType. + * @member {string} machineType + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @instance + */ + WorkerConfig.prototype.machineType = ""; + + /** + * WorkerConfig diskSizeGb. + * @member {number|Long} diskSizeGb + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @instance + */ + WorkerConfig.prototype.diskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new WorkerConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig instance + */ + WorkerConfig.create = function create(properties) { + return new WorkerConfig(properties); + }; + + /** + * Encodes the specified WorkerConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig} message WorkerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.diskSizeGb); + return writer; + }; + + /** + * Encodes the specified WorkerConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig} message WorkerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.diskSizeGb = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + return null; + }; + + /** + * Creates a WorkerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig + */ + WorkerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a WorkerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} message WorkerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskSizeGb = options.longs === String ? "0" : 0; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + return object; + }; + + /** + * Converts this WorkerConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @instance + * @returns {Object.} JSON object + */ + WorkerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkerConfig + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig"; + }; + + return WorkerConfig; + })(); + + PrivatePoolV1Config.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @interface INetworkConfig + * @property {string|null} [peeredNetwork] NetworkConfig peeredNetwork + * @property {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|null} [egressOption] NetworkConfig egressOption + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig peeredNetwork. + * @member {string} peeredNetwork + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @instance + */ + NetworkConfig.prototype.peeredNetwork = ""; + + /** + * NetworkConfig egressOption. + * @member {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption} egressOption + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @instance + */ + NetworkConfig.prototype.egressOption = 0; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peeredNetwork != null && Object.hasOwnProperty.call(message, "peeredNetwork")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peeredNetwork); + if (message.egressOption != null && Object.hasOwnProperty.call(message, "egressOption")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egressOption); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.peeredNetwork = reader.string(); + break; + } + case 2: { + message.egressOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peeredNetwork != null && message.hasOwnProperty("peeredNetwork")) + if (!$util.isString(message.peeredNetwork)) + return "peeredNetwork: string expected"; + if (message.egressOption != null && message.hasOwnProperty("egressOption")) + switch (message.egressOption) { + default: + return "egressOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig(); + if (object.peeredNetwork != null) + message.peeredNetwork = String(object.peeredNetwork); + switch (object.egressOption) { + default: + if (typeof object.egressOption === "number") { + message.egressOption = object.egressOption; + break; + } + break; + case "EGRESS_OPTION_UNSPECIFIED": + case 0: + message.egressOption = 0; + break; + case "NO_PUBLIC_EGRESS": + case 1: + message.egressOption = 1; + break; + case "PUBLIC_EGRESS": + case 2: + message.egressOption = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.peeredNetwork = ""; + object.egressOption = options.enums === String ? "EGRESS_OPTION_UNSPECIFIED" : 0; + } + if (message.peeredNetwork != null && message.hasOwnProperty("peeredNetwork")) + object.peeredNetwork = message.peeredNetwork; + if (message.egressOption != null && message.hasOwnProperty("egressOption")) + object.egressOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption[message.egressOption] === undefined ? message.egressOption : $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption[message.egressOption] : message.egressOption; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig"; + }; + + /** + * EgressOption enum. + * @name google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption + * @enum {number} + * @property {number} EGRESS_OPTION_UNSPECIFIED=0 EGRESS_OPTION_UNSPECIFIED value + * @property {number} NO_PUBLIC_EGRESS=1 NO_PUBLIC_EGRESS value + * @property {number} PUBLIC_EGRESS=2 PUBLIC_EGRESS value + */ + NetworkConfig.EgressOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EGRESS_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_PUBLIC_EGRESS"] = 1; + values[valuesById[2] = "PUBLIC_EGRESS"] = 2; + return values; + })(); + + return NetworkConfig; + })(); + + return PrivatePoolV1Config; + })(); + + v1.CreateWorkerPoolRequest = (function() { + + /** + * Properties of a CreateWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface ICreateWorkerPoolRequest + * @property {string|null} [parent] CreateWorkerPoolRequest parent + * @property {google.devtools.cloudbuild.v1.IWorkerPool|null} [workerPool] CreateWorkerPoolRequest workerPool + * @property {string|null} [workerPoolId] CreateWorkerPoolRequest workerPoolId + * @property {boolean|null} [validateOnly] CreateWorkerPoolRequest validateOnly + */ + + /** + * Constructs a new CreateWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CreateWorkerPoolRequest. + * @implements ICreateWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest=} [properties] Properties to set + */ + function CreateWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkerPoolRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.parent = ""; + + /** + * CreateWorkerPoolRequest workerPool. + * @member {google.devtools.cloudbuild.v1.IWorkerPool|null|undefined} workerPool + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.workerPool = null; + + /** + * CreateWorkerPoolRequest workerPoolId. + * @member {string} workerPoolId + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.workerPoolId = ""; + + /** + * CreateWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest instance + */ + CreateWorkerPoolRequest.create = function create(properties) { + return new CreateWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolRequest.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.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.workerPoolId != null && Object.hasOwnProperty.call(message, "workerPoolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.workerPoolId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32()); + break; + } + case 3: { + message.workerPoolId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkerPoolRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkerPoolRequest.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.workerPool != null && message.hasOwnProperty("workerPool")) { + var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPool); + if (error) + return "workerPool." + error; + } + if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) + if (!$util.isString(message.workerPoolId)) + return "workerPoolId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + */ + CreateWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workerPool != null) { + if (typeof object.workerPool !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.workerPool: object expected"); + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPool); + } + if (object.workerPoolId != null) + message.workerPoolId = String(object.workerPoolId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} message CreateWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workerPool = null; + object.workerPoolId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPool, options); + if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) + object.workerPoolId = message.workerPoolId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkerPoolRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.CreateWorkerPoolRequest"; + }; + + return CreateWorkerPoolRequest; + })(); + + v1.GetWorkerPoolRequest = (function() { + + /** + * Properties of a GetWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IGetWorkerPoolRequest + * @property {string|null} [name] GetWorkerPoolRequest name + */ + + /** + * Constructs a new GetWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a GetWorkerPoolRequest. + * @implements IGetWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest=} [properties] Properties to set + */ + function GetWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkerPoolRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @instance + */ + GetWorkerPoolRequest.prototype.name = ""; + + /** + * Creates a new GetWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest instance + */ + GetWorkerPoolRequest.create = function create(properties) { + return new GetWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkerPoolRequest.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 GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkerPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest(); + 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 GetWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkerPoolRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkerPoolRequest.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 GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + */ + GetWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} message GetWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkerPoolRequest.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 GetWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWorkerPoolRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.GetWorkerPoolRequest"; + }; + + return GetWorkerPoolRequest; + })(); + + v1.DeleteWorkerPoolRequest = (function() { + + /** + * Properties of a DeleteWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IDeleteWorkerPoolRequest + * @property {string|null} [name] DeleteWorkerPoolRequest name + * @property {string|null} [etag] DeleteWorkerPoolRequest etag + * @property {boolean|null} [allowMissing] DeleteWorkerPoolRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteWorkerPoolRequest validateOnly + */ + + /** + * Constructs a new DeleteWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a DeleteWorkerPoolRequest. + * @implements IDeleteWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest=} [properties] Properties to set + */ + function DeleteWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkerPoolRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.name = ""; + + /** + * DeleteWorkerPoolRequest etag. + * @member {string} etag + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.etag = ""; + + /** + * DeleteWorkerPoolRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.allowMissing = false; + + /** + * DeleteWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest instance + */ + DeleteWorkerPoolRequest.create = function create(properties) { + return new DeleteWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolRequest.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkerPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkerPoolRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkerPoolRequest.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + */ + DeleteWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} message DeleteWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this DeleteWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkerPoolRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest"; + }; + + return DeleteWorkerPoolRequest; + })(); + + v1.UpdateWorkerPoolRequest = (function() { + + /** + * Properties of an UpdateWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IUpdateWorkerPoolRequest + * @property {google.devtools.cloudbuild.v1.IWorkerPool|null} [workerPool] UpdateWorkerPoolRequest workerPool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkerPoolRequest updateMask + * @property {boolean|null} [validateOnly] UpdateWorkerPoolRequest validateOnly + */ + + /** + * Constructs a new UpdateWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an UpdateWorkerPoolRequest. + * @implements IUpdateWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest=} [properties] Properties to set + */ + function UpdateWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkerPoolRequest workerPool. + * @member {google.devtools.cloudbuild.v1.IWorkerPool|null|undefined} workerPool + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.workerPool = null; + + /** + * UpdateWorkerPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.updateMask = null; + + /** + * UpdateWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest instance + */ + UpdateWorkerPoolRequest.create = function create(properties) { + return new UpdateWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkerPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPool, 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(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkerPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkerPoolRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkerPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) { + var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPool); + if (error) + return "workerPool." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + */ + UpdateWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest(); + if (object.workerPool != null) { + if (typeof object.workerPool !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.workerPool: object expected"); + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} message UpdateWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkerPoolRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkerPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest"; + }; + + return UpdateWorkerPoolRequest; + })(); + + v1.ListWorkerPoolsRequest = (function() { + + /** + * Properties of a ListWorkerPoolsRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IListWorkerPoolsRequest + * @property {string|null} [parent] ListWorkerPoolsRequest parent + * @property {number|null} [pageSize] ListWorkerPoolsRequest pageSize + * @property {string|null} [pageToken] ListWorkerPoolsRequest pageToken + */ + + /** + * Constructs a new ListWorkerPoolsRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ListWorkerPoolsRequest. + * @implements IListWorkerPoolsRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest=} [properties] Properties to set + */ + function ListWorkerPoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkerPoolsRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.parent = ""; + + /** + * ListWorkerPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.pageSize = 0; + + /** + * ListWorkerPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWorkerPoolsRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest instance + */ + ListWorkerPoolsRequest.create = function create(properties) { + return new ListWorkerPoolsRequest(properties); + }; + + /** + * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkerPoolsRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkerPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest + */ + ListWorkerPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} message ListWorkerPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkerPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListWorkerPoolsRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkerPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkerPoolsRequest + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkerPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ListWorkerPoolsRequest"; + }; + + return ListWorkerPoolsRequest; + })(); + + v1.ListWorkerPoolsResponse = (function() { + + /** + * Properties of a ListWorkerPoolsResponse. + * @memberof google.devtools.cloudbuild.v1 + * @interface IListWorkerPoolsResponse + * @property {Array.|null} [workerPools] ListWorkerPoolsResponse workerPools + * @property {string|null} [nextPageToken] ListWorkerPoolsResponse nextPageToken + */ + + /** + * Constructs a new ListWorkerPoolsResponse. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a ListWorkerPoolsResponse. + * @implements IListWorkerPoolsResponse + * @constructor + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse=} [properties] Properties to set + */ + function ListWorkerPoolsResponse(properties) { + this.workerPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkerPoolsResponse workerPools. + * @member {Array.} workerPools + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @instance + */ + ListWorkerPoolsResponse.prototype.workerPools = $util.emptyArray; + + /** + * ListWorkerPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @instance + */ + ListWorkerPoolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWorkerPoolsResponse instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse instance + */ + ListWorkerPoolsResponse.create = function create(properties) { + return new ListWorkerPoolsResponse(properties); + }; + + /** + * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPools != null && message.workerPools.length) + for (var i = 0; i < message.workerPools.length; ++i) + $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPools[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 ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkerPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workerPools && message.workerPools.length)) + message.workerPools = []; + message.workerPools.push($root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkerPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkerPoolsResponse message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkerPoolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPools != null && message.hasOwnProperty("workerPools")) { + if (!Array.isArray(message.workerPools)) + return "workerPools: array expected"; + for (var i = 0; i < message.workerPools.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPools[i]); + if (error) + return "workerPools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse + */ + ListWorkerPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse) + return object; + var message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse(); + if (object.workerPools) { + if (!Array.isArray(object.workerPools)) + throw TypeError(".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.workerPools: array expected"); + message.workerPools = []; + for (var i = 0; i < object.workerPools.length; ++i) { + if (typeof object.workerPools[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.workerPools: object expected"); + message.workerPools[i] = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} message ListWorkerPoolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkerPoolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.workerPools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.workerPools && message.workerPools.length) { + object.workerPools = []; + for (var j = 0; j < message.workerPools.length; ++j) + object.workerPools[j] = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListWorkerPoolsResponse to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkerPoolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkerPoolsResponse + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkerPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.ListWorkerPoolsResponse"; + }; + + return ListWorkerPoolsResponse; + })(); + + v1.CreateWorkerPoolOperationMetadata = (function() { + + /** + * Properties of a CreateWorkerPoolOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @interface ICreateWorkerPoolOperationMetadata + * @property {string|null} [workerPool] CreateWorkerPoolOperationMetadata workerPool + * @property {google.protobuf.ITimestamp|null} [createTime] CreateWorkerPoolOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [completeTime] CreateWorkerPoolOperationMetadata completeTime + */ + + /** + * Constructs a new CreateWorkerPoolOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CreateWorkerPoolOperationMetadata. + * @implements ICreateWorkerPoolOperationMetadata + * @constructor + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata=} [properties] Properties to set + */ + function CreateWorkerPoolOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkerPoolOperationMetadata workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @instance + */ + CreateWorkerPoolOperationMetadata.prototype.workerPool = ""; + + /** + * CreateWorkerPoolOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @instance + */ + CreateWorkerPoolOperationMetadata.prototype.createTime = null; + + /** + * CreateWorkerPoolOperationMetadata completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @instance + */ + CreateWorkerPoolOperationMetadata.prototype.completeTime = null; + + /** + * Creates a new CreateWorkerPoolOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata instance + */ + CreateWorkerPoolOperationMetadata.create = function create(properties) { + return new CreateWorkerPoolOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata} message CreateWorkerPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata} message CreateWorkerPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerPool = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkerPoolOperationMetadata message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkerPoolOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + return null; + }; + + /** + * Creates a CreateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata + */ + CreateWorkerPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + return message; + }; + + /** + * Creates a plain object from a CreateWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} message CreateWorkerPoolOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkerPoolOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = ""; + object.createTime = null; + object.completeTime = null; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + return object; + }; + + /** + * Converts this CreateWorkerPoolOperationMetadata to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateWorkerPoolOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkerPoolOperationMetadata + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkerPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata"; + }; + + return CreateWorkerPoolOperationMetadata; + })(); + + v1.UpdateWorkerPoolOperationMetadata = (function() { + + /** + * Properties of an UpdateWorkerPoolOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @interface IUpdateWorkerPoolOperationMetadata + * @property {string|null} [workerPool] UpdateWorkerPoolOperationMetadata workerPool + * @property {google.protobuf.ITimestamp|null} [createTime] UpdateWorkerPoolOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [completeTime] UpdateWorkerPoolOperationMetadata completeTime + */ + + /** + * Constructs a new UpdateWorkerPoolOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents an UpdateWorkerPoolOperationMetadata. + * @implements IUpdateWorkerPoolOperationMetadata + * @constructor + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata=} [properties] Properties to set + */ + function UpdateWorkerPoolOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkerPoolOperationMetadata workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @instance + */ + UpdateWorkerPoolOperationMetadata.prototype.workerPool = ""; + + /** + * UpdateWorkerPoolOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @instance + */ + UpdateWorkerPoolOperationMetadata.prototype.createTime = null; + + /** + * UpdateWorkerPoolOperationMetadata completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @instance + */ + UpdateWorkerPoolOperationMetadata.prototype.completeTime = null; + + /** + * Creates a new UpdateWorkerPoolOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata instance + */ + UpdateWorkerPoolOperationMetadata.create = function create(properties) { + return new UpdateWorkerPoolOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata} message UpdateWorkerPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkerPoolOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata} message UpdateWorkerPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkerPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkerPoolOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerPool = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkerPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkerPoolOperationMetadata message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkerPoolOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + return null; + }; + + /** + * Creates an UpdateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata + */ + UpdateWorkerPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata) + return object; + var message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} message UpdateWorkerPoolOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkerPoolOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = ""; + object.createTime = null; + object.completeTime = null; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + return object; + }; + + /** + * Converts this UpdateWorkerPoolOperationMetadata to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkerPoolOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkerPoolOperationMetadata + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkerPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata"; + }; + + return UpdateWorkerPoolOperationMetadata; + })(); + + v1.DeleteWorkerPoolOperationMetadata = (function() { + + /** + * Properties of a DeleteWorkerPoolOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @interface IDeleteWorkerPoolOperationMetadata + * @property {string|null} [workerPool] DeleteWorkerPoolOperationMetadata workerPool + * @property {google.protobuf.ITimestamp|null} [createTime] DeleteWorkerPoolOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [completeTime] DeleteWorkerPoolOperationMetadata completeTime + */ + + /** + * Constructs a new DeleteWorkerPoolOperationMetadata. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a DeleteWorkerPoolOperationMetadata. + * @implements IDeleteWorkerPoolOperationMetadata + * @constructor + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata=} [properties] Properties to set + */ + function DeleteWorkerPoolOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkerPoolOperationMetadata workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @instance + */ + DeleteWorkerPoolOperationMetadata.prototype.workerPool = ""; + + /** + * DeleteWorkerPoolOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @instance + */ + DeleteWorkerPoolOperationMetadata.prototype.createTime = null; + + /** + * DeleteWorkerPoolOperationMetadata completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @instance + */ + DeleteWorkerPoolOperationMetadata.prototype.completeTime = null; + + /** + * Creates a new DeleteWorkerPoolOperationMetadata instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata instance + */ + DeleteWorkerPoolOperationMetadata.create = function create(properties) { + return new DeleteWorkerPoolOperationMetadata(properties); + }; + + /** + * Encodes the specified DeleteWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata} message DeleteWorkerPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata} message DeleteWorkerPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkerPoolOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workerPool = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkerPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkerPoolOperationMetadata message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkerPoolOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + return null; + }; + + /** + * Creates a DeleteWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata + */ + DeleteWorkerPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata) + return object; + var message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + return message; + }; + + /** + * Creates a plain object from a DeleteWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} message DeleteWorkerPoolOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkerPoolOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workerPool = ""; + object.createTime = null; + object.completeTime = null; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + return object; + }; + + /** + * Converts this DeleteWorkerPoolOperationMetadata to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkerPoolOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkerPoolOperationMetadata + * @function getTypeUrl + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkerPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata"; + }; + + return DeleteWorkerPoolOperationMetadata; + })(); + + return v1; + })(); + + return cloudbuild; + })(); + + return devtools; + })(); + + 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.HttpBody = (function() { + + /** + * Properties of a HttpBody. + * @memberof google.api + * @interface IHttpBody + * @property {string|null} [contentType] HttpBody contentType + * @property {Uint8Array|null} [data] HttpBody data + * @property {Array.|null} [extensions] HttpBody extensions + */ + + /** + * Constructs a new HttpBody. + * @memberof google.api + * @classdesc Represents a HttpBody. + * @implements IHttpBody + * @constructor + * @param {google.api.IHttpBody=} [properties] Properties to set + */ + function HttpBody(properties) { + this.extensions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpBody contentType. + * @member {string} contentType + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.contentType = ""; + + /** + * HttpBody data. + * @member {Uint8Array} data + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.data = $util.newBuffer([]); + + /** + * HttpBody extensions. + * @member {Array.} extensions + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.extensions = $util.emptyArray; + + /** + * Creates a new HttpBody instance using the specified properties. + * @function create + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody=} [properties] Properties to set + * @returns {google.api.HttpBody} HttpBody instance + */ + HttpBody.create = function create(properties) { + return new HttpBody(properties); + }; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encode + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.extensions != null && message.extensions.length) + for (var i = 0; i < message.extensions.length; ++i) + $root.google.protobuf.Any.encode(message.extensions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decode = function 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.HttpBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + case 3: { + if (!(message.extensions && message.extensions.length)) + message.extensions = []; + message.extensions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpBody message. + * @function verify + * @memberof google.api.HttpBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.extensions != null && message.hasOwnProperty("extensions")) { + if (!Array.isArray(message.extensions)) + return "extensions: array expected"; + for (var i = 0; i < message.extensions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensions[i]); + if (error) + return "extensions." + error; + } + } + return null; + }; + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpBody + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpBody} HttpBody + */ + HttpBody.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpBody) + return object; + var message = new $root.google.api.HttpBody(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.extensions) { + if (!Array.isArray(object.extensions)) + throw TypeError(".google.api.HttpBody.extensions: array expected"); + message.extensions = []; + for (var i = 0; i < object.extensions.length; ++i) { + if (typeof object.extensions[i] !== "object") + throw TypeError(".google.api.HttpBody.extensions: object expected"); + message.extensions[i] = $root.google.protobuf.Any.fromObject(object.extensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpBody + * @static + * @param {google.api.HttpBody} message HttpBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extensions = []; + if (options.defaults) { + object.contentType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.extensions && message.extensions.length) { + object.extensions = []; + for (var j = 0; j < message.extensions.length; ++j) + object.extensions[j] = $root.google.protobuf.Any.toObject(message.extensions[j], options); + } + return object; + }; + + /** + * Converts this HttpBody to JSON. + * @function toJSON + * @memberof google.api.HttpBody + * @instance + * @returns {Object.} JSON object + */ + HttpBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpBody + * @function getTypeUrl + * @memberof google.api.HttpBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpBody"; + }; + + return HttpBody; + })(); + + 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 + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.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.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-devtools-cloudbuild/protos/protos.json b/packages/google-devtools-cloudbuild/protos/protos.json new file mode 100644 index 000000000000..eb38e36773e2 --- /dev/null +++ b/packages/google-devtools-cloudbuild/protos/protos.json @@ -0,0 +1,3889 @@ +{ + "nested": { + "google": { + "nested": { + "devtools": { + "nested": { + "cloudbuild": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.CloudBuild.V1", + "go_package": "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild", + "java_multiple_files": true, + "java_package": "com.google.cloudbuild.v1", + "objc_class_prefix": "GCB", + "ruby_package": "Google::Cloud::Build::V1", + "(google.api.resource_definition).type": "pubsub.googleapis.com/Topic", + "(google.api.resource_definition).pattern": "projects/{project}/topics/{topic}" + }, + "nested": { + "CloudBuild": { + "options": { + "(google.api.default_host)": "cloudbuild.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateBuild": { + "requestType": "CreateBuildRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/builds", + "(google.api.http).body": "build", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*}/builds", + "(google.api.http).additional_bindings.body": "build", + "(google.api.method_signature)": "project_id,build", + "(google.longrunning.operation_info).response_type": "Build", + "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/builds", + "body": "build", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*}/builds", + "body": "build" + } + } + }, + { + "(google.api.method_signature)": "project_id,build" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Build", + "metadata_type": "BuildOperationMetadata" + } + } + ] + }, + "GetBuild": { + "requestType": "GetBuildRequest", + "responseType": "Build", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/builds/{id}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/builds/*}", + "(google.api.method_signature)": "project_id,id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/builds/{id}", + "additional_bindings": { + "get": "/v1/{name=projects/*/locations/*/builds/*}" + } + } + }, + { + "(google.api.method_signature)": "project_id,id" + } + ] + }, + "ListBuilds": { + "requestType": "ListBuildsRequest", + "responseType": "ListBuildsResponse", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/builds", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*}/builds", + "(google.api.method_signature)": "project_id,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/builds", + "additional_bindings": { + "get": "/v1/{parent=projects/*/locations/*}/builds" + } + } + }, + { + "(google.api.method_signature)": "project_id,filter" + } + ] + }, + "CancelBuild": { + "requestType": "CancelBuildRequest", + "responseType": "Build", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/builds/{id}:cancel", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/builds/*}:cancel", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "project_id,id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/builds/{id}:cancel", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/builds/*}:cancel", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "project_id,id" + } + ] + }, + "RetryBuild": { + "requestType": "RetryBuildRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/builds/{id}:retry", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/builds/*}:retry", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "project_id,id", + "(google.longrunning.operation_info).response_type": "Build", + "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/builds/{id}:retry", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/builds/*}:retry", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "project_id,id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Build", + "metadata_type": "BuildOperationMetadata" + } + } + ] + }, + "ApproveBuild": { + "requestType": "ApproveBuildRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/builds/*}:approve", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/builds/*}:approve", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,approval_result", + "(google.longrunning.operation_info).response_type": "Build", + "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/builds/*}:approve", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/builds/*}:approve", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name,approval_result" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Build", + "metadata_type": "BuildOperationMetadata" + } + } + ] + }, + "CreateBuildTrigger": { + "requestType": "CreateBuildTriggerRequest", + "responseType": "BuildTrigger", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/triggers", + "(google.api.http).body": "trigger", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*}/triggers", + "(google.api.http).additional_bindings.body": "trigger", + "(google.api.method_signature)": "project_id,trigger" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/triggers", + "body": "trigger", + "additional_bindings": { + "post": "/v1/{parent=projects/*/locations/*}/triggers", + "body": "trigger" + } + } + }, + { + "(google.api.method_signature)": "project_id,trigger" + } + ] + }, + "GetBuildTrigger": { + "requestType": "GetBuildTriggerRequest", + "responseType": "BuildTrigger", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/triggers/{trigger_id}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/triggers/*}", + "(google.api.method_signature)": "project_id,trigger_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/triggers/{trigger_id}", + "additional_bindings": { + "get": "/v1/{name=projects/*/locations/*/triggers/*}" + } + } + }, + { + "(google.api.method_signature)": "project_id,trigger_id" + } + ] + }, + "ListBuildTriggers": { + "requestType": "ListBuildTriggersRequest", + "responseType": "ListBuildTriggersResponse", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/triggers", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*}/triggers", + "(google.api.method_signature)": "project_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/triggers", + "additional_bindings": { + "get": "/v1/{parent=projects/*/locations/*}/triggers" + } + } + }, + { + "(google.api.method_signature)": "project_id" + } + ] + }, + "DeleteBuildTrigger": { + "requestType": "DeleteBuildTriggerRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/projects/{project_id}/triggers/{trigger_id}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/locations/*/triggers/*}", + "(google.api.method_signature)": "project_id,trigger_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/projects/{project_id}/triggers/{trigger_id}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/locations/*/triggers/*}" + } + } + }, + { + "(google.api.method_signature)": "project_id,trigger_id" + } + ] + }, + "UpdateBuildTrigger": { + "requestType": "UpdateBuildTriggerRequest", + "responseType": "BuildTrigger", + "options": { + "(google.api.http).patch": "/v1/projects/{project_id}/triggers/{trigger_id}", + "(google.api.http).body": "trigger", + "(google.api.http).additional_bindings.patch": "/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}", + "(google.api.http).additional_bindings.body": "trigger", + "(google.api.method_signature)": "project_id,trigger_id,trigger" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/projects/{project_id}/triggers/{trigger_id}", + "body": "trigger", + "additional_bindings": { + "patch": "/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}", + "body": "trigger" + } + } + }, + { + "(google.api.method_signature)": "project_id,trigger_id,trigger" + } + ] + }, + "RunBuildTrigger": { + "requestType": "RunBuildTriggerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/triggers/{trigger_id}:run", + "(google.api.http).body": "source", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/triggers/*}:run", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "project_id,trigger_id,source", + "(google.longrunning.operation_info).response_type": "Build", + "(google.longrunning.operation_info).metadata_type": "BuildOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/triggers/{trigger_id}:run", + "body": "source", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/triggers/*}:run", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "project_id,trigger_id,source" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Build", + "metadata_type": "BuildOperationMetadata" + } + } + ] + }, + "ReceiveTriggerWebhook": { + "requestType": "ReceiveTriggerWebhookRequest", + "responseType": "ReceiveTriggerWebhookResponse", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/triggers/{trigger}:webhook", + "(google.api.http).body": "body", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/locations/*/triggers/*}:webhook", + "(google.api.http).additional_bindings.body": "body" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/triggers/{trigger}:webhook", + "body": "body", + "additional_bindings": { + "post": "/v1/{name=projects/*/locations/*/triggers/*}:webhook", + "body": "body" + } + } + } + ] + }, + "CreateWorkerPool": { + "requestType": "CreateWorkerPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workerPools", + "(google.api.http).body": "worker_pool", + "(google.api.method_signature)": "parent,worker_pool,worker_pool_id", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "CreateWorkerPoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/workerPools", + "body": "worker_pool" + } + }, + { + "(google.api.method_signature)": "parent,worker_pool,worker_pool_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "CreateWorkerPoolOperationMetadata" + } + } + ] + }, + "GetWorkerPool": { + "requestType": "GetWorkerPoolRequest", + "responseType": "WorkerPool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workerPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workerPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteWorkerPool": { + "requestType": "DeleteWorkerPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workerPools/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteWorkerPoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workerPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteWorkerPoolOperationMetadata" + } + } + ] + }, + "UpdateWorkerPool": { + "requestType": "UpdateWorkerPoolRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}", + "(google.api.http).body": "worker_pool", + "(google.api.method_signature)": "worker_pool,update_mask", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "UpdateWorkerPoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}", + "body": "worker_pool" + } + }, + { + "(google.api.method_signature)": "worker_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "UpdateWorkerPoolOperationMetadata" + } + } + ] + }, + "ListWorkerPools": { + "requestType": "ListWorkerPoolsRequest", + "responseType": "ListWorkerPoolsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/workerPools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/workerPools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "RetryBuildRequest": { + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RunBuildTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildTrigger" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "source": { + "type": "RepoSource", + "id": 3 + } + } + }, + "StorageSource": { + "fields": { + "bucket": { + "type": "string", + "id": 1 + }, + "object": { + "type": "string", + "id": 2 + }, + "generation": { + "type": "int64", + "id": 3 + } + } + }, + "RepoSource": { + "oneofs": { + "revision": { + "oneof": [ + "branchName", + "tagName", + "commitSha" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 1 + }, + "repoName": { + "type": "string", + "id": 2 + }, + "branchName": { + "type": "string", + "id": 3 + }, + "tagName": { + "type": "string", + "id": 4 + }, + "commitSha": { + "type": "string", + "id": 5 + }, + "dir": { + "type": "string", + "id": 7 + }, + "invertRegex": { + "type": "bool", + "id": 8 + }, + "substitutions": { + "keyType": "string", + "type": "string", + "id": 9 + } + } + }, + "StorageSourceManifest": { + "fields": { + "bucket": { + "type": "string", + "id": 1 + }, + "object": { + "type": "string", + "id": 2 + }, + "generation": { + "type": "int64", + "id": 3 + } + } + }, + "Source": { + "oneofs": { + "source": { + "oneof": [ + "storageSource", + "repoSource", + "storageSourceManifest" + ] + } + }, + "fields": { + "storageSource": { + "type": "StorageSource", + "id": 2 + }, + "repoSource": { + "type": "RepoSource", + "id": 3 + }, + "storageSourceManifest": { + "type": "StorageSourceManifest", + "id": 8 + } + } + }, + "BuiltImage": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "digest": { + "type": "string", + "id": 3 + }, + "pushTiming": { + "type": "TimeSpan", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UploadedPythonPackage": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "fileHashes": { + "type": "FileHashes", + "id": 2 + }, + "pushTiming": { + "type": "TimeSpan", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UploadedMavenArtifact": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "fileHashes": { + "type": "FileHashes", + "id": 2 + }, + "pushTiming": { + "type": "TimeSpan", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BuildStep": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "env": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "dir": { + "type": "string", + "id": 4 + }, + "id": { + "type": "string", + "id": 5 + }, + "waitFor": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "entrypoint": { + "type": "string", + "id": 7 + }, + "secretEnv": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 9 + }, + "timing": { + "type": "TimeSpan", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pullTiming": { + "type": "TimeSpan", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 11 + }, + "status": { + "type": "Build.Status", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allowFailure": { + "type": "bool", + "id": 14 + }, + "exitCode": { + "type": "int32", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allowExitCodes": { + "rule": "repeated", + "type": "int32", + "id": 18 + }, + "script": { + "type": "string", + "id": 19 + } + } + }, + "Volume": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "Results": { + "fields": { + "images": { + "rule": "repeated", + "type": "BuiltImage", + "id": 2 + }, + "buildStepImages": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "artifactManifest": { + "type": "string", + "id": 4 + }, + "numArtifacts": { + "type": "int64", + "id": 5 + }, + "buildStepOutputs": { + "rule": "repeated", + "type": "bytes", + "id": 6 + }, + "artifactTiming": { + "type": "TimeSpan", + "id": 7 + }, + "pythonPackages": { + "rule": "repeated", + "type": "UploadedPythonPackage", + "id": 8 + }, + "mavenArtifacts": { + "rule": "repeated", + "type": "UploadedMavenArtifact", + "id": 9 + } + } + }, + "ArtifactResult": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "fileHash": { + "rule": "repeated", + "type": "FileHashes", + "id": 2 + } + } + }, + "Build": { + "options": { + "(google.api.resource).type": "cloudbuild.googleapis.com/Build", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/builds/{build}" + }, + "fields": { + "name": { + "type": "string", + "id": 45, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "projectId": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "Status", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusDetail": { + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "source": { + "type": "Source", + "id": 3 + }, + "steps": { + "rule": "repeated", + "type": "BuildStep", + "id": 11 + }, + "results": { + "type": "Results", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "finishTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 12 + }, + "images": { + "rule": "repeated", + "type": "string", + "id": 13 + }, + "queueTtl": { + "type": "google.protobuf.Duration", + "id": 40 + }, + "artifacts": { + "type": "Artifacts", + "id": 37 + }, + "logsBucket": { + "type": "string", + "id": 19 + }, + "sourceProvenance": { + "type": "SourceProvenance", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "buildTriggerId": { + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "options": { + "type": "BuildOptions", + "id": 23 + }, + "logUrl": { + "type": "string", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "substitutions": { + "keyType": "string", + "type": "string", + "id": 29 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 31 + }, + "secrets": { + "rule": "repeated", + "type": "Secret", + "id": 32 + }, + "timing": { + "keyType": "string", + "type": "TimeSpan", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approval": { + "type": "BuildApproval", + "id": 44, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 42, + "options": { + "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" + } + }, + "availableSecrets": { + "type": "Secrets", + "id": 47 + }, + "warnings": { + "rule": "repeated", + "type": "Warning", + "id": 49, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "failureInfo": { + "type": "FailureInfo", + "id": 51, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Warning": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "priority": { + "type": "Priority", + "id": 2 + } + }, + "nested": { + "Priority": { + "values": { + "PRIORITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ALERT": 3 + } + } + } + }, + "FailureInfo": { + "fields": { + "type": { + "type": "FailureType", + "id": 1 + }, + "detail": { + "type": "string", + "id": 2 + } + }, + "nested": { + "FailureType": { + "values": { + "FAILURE_TYPE_UNSPECIFIED": 0, + "PUSH_FAILED": 1, + "PUSH_IMAGE_NOT_FOUND": 2, + "PUSH_NOT_AUTHORIZED": 3, + "LOGGING_FAILURE": 4, + "USER_BUILD_STEP": 5, + "FETCH_SOURCE_FAILED": 6 + } + } + } + }, + "Status": { + "values": { + "STATUS_UNKNOWN": 0, + "PENDING": 10, + "QUEUED": 1, + "WORKING": 2, + "SUCCESS": 3, + "FAILURE": 4, + "INTERNAL_ERROR": 5, + "TIMEOUT": 6, + "CANCELLED": 7, + "EXPIRED": 9 + } + } + } + }, + "Artifacts": { + "fields": { + "images": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "objects": { + "type": "ArtifactObjects", + "id": 2 + }, + "mavenArtifacts": { + "rule": "repeated", + "type": "MavenArtifact", + "id": 3 + }, + "pythonPackages": { + "rule": "repeated", + "type": "PythonPackage", + "id": 5 + } + }, + "nested": { + "ArtifactObjects": { + "fields": { + "location": { + "type": "string", + "id": 1 + }, + "paths": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "timing": { + "type": "TimeSpan", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MavenArtifact": { + "fields": { + "repository": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + }, + "artifactId": { + "type": "string", + "id": 3 + }, + "groupId": { + "type": "string", + "id": 4 + }, + "version": { + "type": "string", + "id": 5 + } + } + }, + "PythonPackage": { + "fields": { + "repository": { + "type": "string", + "id": 1 + }, + "paths": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + }, + "TimeSpan": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "BuildOperationMetadata": { + "fields": { + "build": { + "type": "Build", + "id": 1 + } + } + }, + "SourceProvenance": { + "fields": { + "resolvedStorageSource": { + "type": "StorageSource", + "id": 3 + }, + "resolvedRepoSource": { + "type": "RepoSource", + "id": 6 + }, + "resolvedStorageSourceManifest": { + "type": "StorageSourceManifest", + "id": 9 + }, + "fileHashes": { + "keyType": "string", + "type": "FileHashes", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "FileHashes": { + "fields": { + "fileHash": { + "rule": "repeated", + "type": "Hash", + "id": 1 + } + } + }, + "Hash": { + "fields": { + "type": { + "type": "HashType", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + }, + "nested": { + "HashType": { + "values": { + "NONE": 0, + "SHA256": 1, + "MD5": 2 + } + } + } + }, + "Secrets": { + "fields": { + "secretManager": { + "rule": "repeated", + "type": "SecretManagerSecret", + "id": 1 + }, + "inline": { + "rule": "repeated", + "type": "InlineSecret", + "id": 2 + } + } + }, + "InlineSecret": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + }, + "envMap": { + "keyType": "string", + "type": "bytes", + "id": 2 + } + } + }, + "SecretManagerSecret": { + "fields": { + "versionName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "env": { + "type": "string", + "id": 2 + } + } + }, + "Secret": { + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1 + }, + "secretEnv": { + "keyType": "string", + "type": "bytes", + "id": 3 + } + } + }, + "CreateBuildRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).child_type": "cloudbuild.googleapis.com/Build" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "build": { + "type": "Build", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBuildRequest": { + "fields": { + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListBuildsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).child_type": "cloudbuild.googleapis.com/Build" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 8 + } + } + }, + "ListBuildsResponse": { + "fields": { + "builds": { + "rule": "repeated", + "type": "Build", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelBuildRequest": { + "fields": { + "name": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/Build" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ApproveBuildRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "approvalResult": { + "type": "ApprovalResult", + "id": 2 + } + } + }, + "BuildApproval": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "config": { + "type": "ApprovalConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "result": { + "type": "ApprovalResult", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "APPROVED": 2, + "REJECTED": 3, + "CANCELLED": 5 + } + } + } + }, + "ApprovalConfig": { + "fields": { + "approvalRequired": { + "type": "bool", + "id": 1 + } + } + }, + "ApprovalResult": { + "fields": { + "approverAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approvalTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "decision": { + "type": "Decision", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "comment": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "url": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Decision": { + "values": { + "DECISION_UNSPECIFIED": 0, + "APPROVED": 1, + "REJECTED": 2 + } + } + } + }, + "BuildTrigger": { + "options": { + "(google.api.resource).type": "cloudbuild.googleapis.com/BuildTrigger", + "(google.api.resource).plural": "triggers", + "(google.api.resource).singular": "trigger", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/triggers/{trigger}" + }, + "oneofs": { + "buildTemplate": { + "oneof": [ + "autodetect", + "build", + "filename" + ] + } + }, + "fields": { + "resourceName": { + "type": "string", + "id": 34 + }, + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 10 + }, + "name": { + "type": "string", + "id": 21 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 19 + }, + "triggerTemplate": { + "type": "RepoSource", + "id": 7 + }, + "github": { + "type": "GitHubEventsConfig", + "id": 13 + }, + "pubsubConfig": { + "type": "PubsubConfig", + "id": 29 + }, + "webhookConfig": { + "type": "WebhookConfig", + "id": 31 + }, + "autodetect": { + "type": "bool", + "id": 18 + }, + "build": { + "type": "Build", + "id": 4 + }, + "filename": { + "type": "string", + "id": 8 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "disabled": { + "type": "bool", + "id": 9 + }, + "substitutions": { + "keyType": "string", + "type": "string", + "id": 11 + }, + "ignoredFiles": { + "rule": "repeated", + "type": "string", + "id": 15 + }, + "includedFiles": { + "rule": "repeated", + "type": "string", + "id": 16 + }, + "filter": { + "type": "string", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 33, + "options": { + "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" + } + } + } + }, + "GitHubEventsConfig": { + "oneofs": { + "event": { + "oneof": [ + "pullRequest", + "push" + ] + } + }, + "fields": { + "installationId": { + "type": "int64", + "id": 1, + "options": { + "deprecated": true + } + }, + "owner": { + "type": "string", + "id": 6 + }, + "name": { + "type": "string", + "id": 7 + }, + "pullRequest": { + "type": "PullRequestFilter", + "id": 4 + }, + "push": { + "type": "PushFilter", + "id": 5 + } + } + }, + "PubsubConfig": { + "fields": { + "subscription": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "pubsub.googleapis.com/Subscription" + } + }, + "topic": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "pubsub.googleapis.com/Topic" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" + } + }, + "state": { + "type": "State", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "OK": 1, + "SUBSCRIPTION_DELETED": 2, + "TOPIC_DELETED": 3, + "SUBSCRIPTION_MISCONFIGURED": 4 + } + } + } + }, + "WebhookConfig": { + "oneofs": { + "authMethod": { + "oneof": [ + "secret" + ] + } + }, + "fields": { + "secret": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + }, + "state": { + "type": "State", + "id": 4 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "OK": 1, + "SECRET_DELETED": 2 + } + } + } + }, + "PullRequestFilter": { + "oneofs": { + "gitRef": { + "oneof": [ + "branch" + ] + } + }, + "fields": { + "branch": { + "type": "string", + "id": 2 + }, + "commentControl": { + "type": "CommentControl", + "id": 5 + }, + "invertRegex": { + "type": "bool", + "id": 6 + } + }, + "nested": { + "CommentControl": { + "values": { + "COMMENTS_DISABLED": 0, + "COMMENTS_ENABLED": 1, + "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY": 2 + } + } + } + }, + "PushFilter": { + "oneofs": { + "gitRef": { + "oneof": [ + "branch", + "tag" + ] + } + }, + "fields": { + "branch": { + "type": "string", + "id": 2 + }, + "tag": { + "type": "string", + "id": 3 + }, + "invertRegex": { + "type": "bool", + "id": 4 + } + } + }, + "CreateBuildTriggerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).child_type": "cloudbuild.googleapis.com/BuildTrigger" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trigger": { + "type": "BuildTrigger", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBuildTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildTrigger" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListBuildTriggersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).child_type": "cloudbuild.googleapis.com/BuildTrigger" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListBuildTriggersResponse": { + "fields": { + "triggers": { + "rule": "repeated", + "type": "BuildTrigger", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteBuildTriggerRequest": { + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/BuildTrigger" + } + }, + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBuildTriggerRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "triggerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trigger": { + "type": "BuildTrigger", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BuildOptions": { + "fields": { + "sourceProvenanceHash": { + "rule": "repeated", + "type": "Hash.HashType", + "id": 1 + }, + "requestedVerifyOption": { + "type": "VerifyOption", + "id": 2 + }, + "machineType": { + "type": "MachineType", + "id": 3 + }, + "diskSizeGb": { + "type": "int64", + "id": 6 + }, + "substitutionOption": { + "type": "SubstitutionOption", + "id": 4 + }, + "dynamicSubstitutions": { + "type": "bool", + "id": 17 + }, + "logStreamingOption": { + "type": "LogStreamingOption", + "id": 5 + }, + "workerPool": { + "type": "string", + "id": 7, + "options": { + "deprecated": true + } + }, + "pool": { + "type": "PoolOption", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "logging": { + "type": "LoggingMode", + "id": 11 + }, + "env": { + "rule": "repeated", + "type": "string", + "id": 12 + }, + "secretEnv": { + "rule": "repeated", + "type": "string", + "id": 13 + }, + "volumes": { + "rule": "repeated", + "type": "Volume", + "id": 14 + } + }, + "nested": { + "PoolOption": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + } + } + }, + "VerifyOption": { + "values": { + "NOT_VERIFIED": 0, + "VERIFIED": 1 + } + }, + "MachineType": { + "values": { + "UNSPECIFIED": 0, + "N1_HIGHCPU_8": 1, + "N1_HIGHCPU_32": 2, + "E2_HIGHCPU_8": 5, + "E2_HIGHCPU_32": 6 + } + }, + "SubstitutionOption": { + "values": { + "MUST_MATCH": 0, + "ALLOW_LOOSE": 1 + } + }, + "LogStreamingOption": { + "values": { + "STREAM_DEFAULT": 0, + "STREAM_ON": 1, + "STREAM_OFF": 2 + } + }, + "LoggingMode": { + "valuesOptions": { + "STACKDRIVER_ONLY": { + "deprecated": true + } + }, + "values": { + "LOGGING_UNSPECIFIED": 0, + "LEGACY": 1, + "GCS_ONLY": 2, + "STACKDRIVER_ONLY": 3, + "CLOUD_LOGGING_ONLY": 5, + "NONE": 4 + } + } + } + }, + "ReceiveTriggerWebhookRequest": { + "fields": { + "name": { + "type": "string", + "id": 5 + }, + "body": { + "type": "google.api.HttpBody", + "id": 1 + }, + "projectId": { + "type": "string", + "id": 2 + }, + "trigger": { + "type": "string", + "id": 3 + }, + "secret": { + "type": "string", + "id": 4 + } + } + }, + "ReceiveTriggerWebhookResponse": { + "fields": {} + }, + "WorkerPool": { + "options": { + "(google.api.resource).type": "cloudbuild.googleapis.com/WorkerPool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workerPools/{worker_pool}", + "(google.api.resource).plural": "workerPools", + "(google.api.resource).singular": "workerPool", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "config": { + "oneof": [ + "privatePoolV1Config" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "privatePoolV1Config": { + "type": "PrivatePoolV1Config", + "id": 12 + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "RUNNING": 2, + "DELETING": 3, + "DELETED": 4 + } + } + } + }, + "PrivatePoolV1Config": { + "fields": { + "workerConfig": { + "type": "WorkerConfig", + "id": 1 + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 2 + } + }, + "nested": { + "WorkerConfig": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "diskSizeGb": { + "type": "int64", + "id": 2 + } + } + }, + "NetworkConfig": { + "fields": { + "peeredNetwork": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "egressOption": { + "type": "EgressOption", + "id": 2 + } + }, + "nested": { + "EgressOption": { + "values": { + "EGRESS_OPTION_UNSPECIFIED": 0, + "NO_PUBLIC_EGRESS": 1, + "PUBLIC_EGRESS": 2 + } + } + } + } + } + }, + "CreateWorkerPoolRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "workerPool": { + "type": "WorkerPool", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workerPoolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "GetWorkerPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + } + } + }, + "DeleteWorkerPoolRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateWorkerPoolRequest": { + "fields": { + "workerPool": { + "type": "WorkerPool", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "ListWorkerPoolsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListWorkerPoolsResponse": { + "fields": { + "workerPools": { + "rule": "repeated", + "type": "WorkerPool", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateWorkerPoolOperationMetadata": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateWorkerPoolOperationMetadata": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteWorkerPoolOperationMetadata": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + } + } + } + } + } + } + }, + "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 + } + }, + "HttpBody": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + }, + "extensions": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + }, + "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 + } + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-devtools-cloudbuild/samples/.eslintrc.yml b/packages/google-devtools-cloudbuild/samples/.eslintrc.yml new file mode 100644 index 000000000000..4a0465b4fd35 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/.eslintrc.yml @@ -0,0 +1,5 @@ +--- +rules: + no-console: off + node/no-missing-require: off + node/no-extraneous-require: off \ No newline at end of file diff --git a/packages/google-devtools-cloudbuild/samples/README.md b/packages/google-devtools-cloudbuild/samples/README.md new file mode 100644 index 000000000000..3d8ad7ed0c64 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/README.md @@ -0,0 +1,70 @@ +[//]: # "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 Build: Node.js Samples](https://github.com/googleapis/nodejs-cloudbuild) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [List Triggers.](#list-triggers.) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-cloudbuild#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### List Triggers. + +List available build triggers. + +View the [source code](https://github.com/googleapis/nodejs-cloudbuild/blob/main/samples/listBuildTriggers.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-cloudbuild&page=editor&open_in_editor=samples/listBuildTriggers.js,samples/README.md) + +__Usage:__ + + +`node list-build-triggers.js ` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-cloudbuild/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-cloudbuild&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-cloudbuild&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/cloud-build/docs/ diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js new file mode 100644 index 000000000000..5b53567c1463 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.approve_build.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudbuild_v1_generated_CloudBuild_ApproveBuild_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the target build. + * For example: "projects/{$project_id}/builds/{$build_id}" + */ + // const name = 'abc123' + /** + * Approval decision and metadata. + */ + // const approvalResult = {} + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callApproveBuild() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cloudbuildClient.approveBuild(request); + const [response] = await operation.promise(); + console.log(response); + } + + callApproveBuild(); + // [END cloudbuild_v1_generated_CloudBuild_ApproveBuild_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js new file mode 100644 index 000000000000..c8a0e73d01bb --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.cancel_build.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, id) { + // [START cloudbuild_v1_generated_CloudBuild_CancelBuild_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. + */ + /** + * The name of the `Build` to cancel. + * Format: `projects/{project}/locations/{location}/builds/{build}` + */ + // const name = 'abc123' + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + /** + * Required. ID of the build. + */ + // const id = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callCancelBuild() { + // Construct request + const request = { + projectId, + id, + }; + + // Run request + const response = await cloudbuildClient.cancelBuild(request); + console.log(response); + } + + callCancelBuild(); + // [END cloudbuild_v1_generated_CloudBuild_CancelBuild_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js new file mode 100644 index 000000000000..f84f72d9e650 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, build) { + // [START cloudbuild_v1_generated_CloudBuild_CreateBuild_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. + */ + /** + * The parent resource where this build will be created. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + /** + * Required. Build resource to create. + */ + // const build = {} + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callCreateBuild() { + // Construct request + const request = { + projectId, + build, + }; + + // Run request + const [operation] = await cloudbuildClient.createBuild(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBuild(); + // [END cloudbuild_v1_generated_CloudBuild_CreateBuild_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js new file mode 100644 index 000000000000..4be76c8680bc --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_build_trigger.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, trigger) { + // [START cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_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. + */ + /** + * The parent resource where this trigger will be created. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. ID of the project for which to configure automatic builds. + */ + // const projectId = 'abc123' + /** + * Required. `BuildTrigger` to create. + */ + // const trigger = {} + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callCreateBuildTrigger() { + // Construct request + const request = { + projectId, + trigger, + }; + + // Run request + const response = await cloudbuildClient.createBuildTrigger(request); + console.log(response); + } + + callCreateBuildTrigger(); + // [END cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js new file mode 100644 index 000000000000..b41d78f2121b --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.create_worker_pool.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workerPool, workerPoolId) { + // [START cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_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 parent resource where this worker pool will be created. + * Format: `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. `WorkerPool` resource to create. + */ + // const workerPool = {} + /** + * Required. Immutable. The ID to use for the `WorkerPool`, which will become + * the final component of the resource name. + * This value should be 1-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const workerPoolId = 'abc123' + /** + * If set, validate the request and preview the response, but do not actually + * post it. + */ + // const validateOnly = true + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callCreateWorkerPool() { + // Construct request + const request = { + parent, + workerPool, + workerPoolId, + }; + + // Run request + const [operation] = await cloudbuildClient.createWorkerPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateWorkerPool(); + // [END cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js new file mode 100644 index 000000000000..2cebd45aeb91 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_build_trigger.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, triggerId) { + // [START cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_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. + */ + /** + * The name of the `Trigger` to delete. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + */ + // const name = 'abc123' + /** + * Required. ID of the project that owns the trigger. + */ + // const projectId = 'abc123' + /** + * Required. ID of the `BuildTrigger` to delete. + */ + // const triggerId = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callDeleteBuildTrigger() { + // Construct request + const request = { + projectId, + triggerId, + }; + + // Run request + const response = await cloudbuildClient.deleteBuildTrigger(request); + console.log(response); + } + + callDeleteBuildTrigger(); + // [END cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js new file mode 100644 index 000000000000..cb373e0dca15 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.delete_worker_pool.js @@ -0,0 +1,79 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `WorkerPool` to delete. + * Format: + * `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`. + */ + // const name = 'abc123' + /** + * Optional. If this is provided, it must match the server's etag on the + * workerpool for the request to be processed. + */ + // const etag = 'abc123' + /** + * If set to true, and the `WorkerPool` is not found, the request will succeed + * but no action will be taken on the server. + */ + // const allowMissing = true + /** + * If set, validate the request and preview the response, but do not actually + * post it. + */ + // const validateOnly = true + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callDeleteWorkerPool() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await cloudbuildClient.deleteWorkerPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteWorkerPool(); + // [END cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js new file mode 100644 index 000000000000..46098f262a88 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, id) { + // [START cloudbuild_v1_generated_CloudBuild_GetBuild_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. + */ + /** + * The name of the `Build` to retrieve. + * Format: `projects/{project}/locations/{location}/builds/{build}` + */ + // const name = 'abc123' + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + /** + * Required. ID of the build. + */ + // const id = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callGetBuild() { + // Construct request + const request = { + projectId, + id, + }; + + // Run request + const response = await cloudbuildClient.getBuild(request); + console.log(response); + } + + callGetBuild(); + // [END cloudbuild_v1_generated_CloudBuild_GetBuild_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js new file mode 100644 index 000000000000..869ecdc3233a --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_build_trigger.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, triggerId) { + // [START cloudbuild_v1_generated_CloudBuild_GetBuildTrigger_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. + */ + /** + * The name of the `Trigger` to retrieve. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + */ + // const name = 'abc123' + /** + * Required. ID of the project that owns the trigger. + */ + // const projectId = 'abc123' + /** + * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. + */ + // const triggerId = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callGetBuildTrigger() { + // Construct request + const request = { + projectId, + triggerId, + }; + + // Run request + const response = await cloudbuildClient.getBuildTrigger(request); + console.log(response); + } + + callGetBuildTrigger(); + // [END cloudbuild_v1_generated_CloudBuild_GetBuildTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js new file mode 100644 index 000000000000..95cf4571f66c --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.get_worker_pool.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudbuild_v1_generated_CloudBuild_GetWorkerPool_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `WorkerPool` to retrieve. + * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + */ + // const name = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callGetWorkerPool() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cloudbuildClient.getWorkerPool(request); + console.log(response); + } + + callGetWorkerPool(); + // [END cloudbuild_v1_generated_CloudBuild_GetWorkerPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js new file mode 100644 index 000000000000..d11b8fb089c2 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_build_triggers.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START cloudbuild_v1_generated_CloudBuild_ListBuildTriggers_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. + */ + /** + * The parent of the collection of `Triggers`. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. ID of the project for which to list BuildTriggers. + */ + // const projectId = 'abc123' + /** + * Number of results to return in the list. + */ + // const pageSize = 1234 + /** + * Token to provide to skip to a particular spot in the list. + */ + // const pageToken = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callListBuildTriggers() { + // Construct request + const request = { + projectId, + }; + + // Run request + const iterable = await cloudbuildClient.listBuildTriggersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBuildTriggers(); + // [END cloudbuild_v1_generated_CloudBuild_ListBuildTriggers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js new file mode 100644 index 000000000000..be6ed0123ca7 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_builds.js @@ -0,0 +1,85 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START cloudbuild_v1_generated_CloudBuild_ListBuilds_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. + */ + /** + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` + */ + // const parent = 'abc123' + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + /** + * Number of results to return in the list. + */ + // const pageSize = 1234 + /** + * The page token for the next page of Builds. + * If unspecified, the first page of results is returned. + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * See https://google.aip.dev/158 for more. + */ + // const pageToken = 'abc123' + /** + * The raw filter text to constrain the results. + */ + // const filter = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callListBuilds() { + // Construct request + const request = { + projectId, + }; + + // Run request + const iterable = await cloudbuildClient.listBuildsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBuilds(); + // [END cloudbuild_v1_generated_CloudBuild_ListBuilds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js new file mode 100644 index 000000000000..501dce663564 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.list_worker_pools.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudbuild_v1_generated_CloudBuild_ListWorkerPools_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 parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callListWorkerPools() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await cloudbuildClient.listWorkerPoolsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkerPools(); + // [END cloudbuild_v1_generated_CloudBuild_ListWorkerPools_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js new file mode 100644 index 000000000000..e568c13a4fbf --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.receive_trigger_webhook.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START cloudbuild_v1_generated_CloudBuild_ReceiveTriggerWebhook_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. + */ + /** + * The name of the `ReceiveTriggerWebhook` to retrieve. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + */ + // const name = 'abc123' + /** + * HTTP request body. + */ + // const body = {} + /** + * Project in which the specified trigger lives + */ + // const projectId = 'abc123' + /** + * Name of the trigger to run the payload against + */ + // const trigger = 'abc123' + /** + * Secret token used for authorization if an OAuth token isn't provided. + */ + // const secret = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callReceiveTriggerWebhook() { + // Construct request + const request = { + }; + + // Run request + const response = await cloudbuildClient.receiveTriggerWebhook(request); + console.log(response); + } + + callReceiveTriggerWebhook(); + // [END cloudbuild_v1_generated_CloudBuild_ReceiveTriggerWebhook_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js new file mode 100644 index 000000000000..5ce8f753f054 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.retry_build.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, id) { + // [START cloudbuild_v1_generated_CloudBuild_RetryBuild_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. + */ + /** + * The name of the `Build` to retry. + * Format: `projects/{project}/locations/{location}/builds/{build}` + */ + // const name = 'abc123' + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + /** + * Required. Build ID of the original build. + */ + // const id = 'abc123' + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callRetryBuild() { + // Construct request + const request = { + projectId, + id, + }; + + // Run request + const [operation] = await cloudbuildClient.retryBuild(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRetryBuild(); + // [END cloudbuild_v1_generated_CloudBuild_RetryBuild_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js new file mode 100644 index 000000000000..5dcbc3bbc792 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.run_build_trigger.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, triggerId) { + // [START cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_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. + */ + /** + * The name of the `Trigger` to run. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + */ + // const name = 'abc123' + /** + * Required. ID of the project. + */ + // const projectId = 'abc123' + /** + * Required. ID of the trigger. + */ + // const triggerId = 'abc123' + /** + * Source to build against this trigger. + */ + // const source = {} + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callRunBuildTrigger() { + // Construct request + const request = { + projectId, + triggerId, + }; + + // Run request + const [operation] = await cloudbuildClient.runBuildTrigger(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRunBuildTrigger(); + // [END cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js new file mode 100644 index 000000000000..3c82e6354d7a --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_build_trigger.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, triggerId, trigger) { + // [START cloudbuild_v1_generated_CloudBuild_UpdateBuildTrigger_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. ID of the project that owns the trigger. + */ + // const projectId = 'abc123' + /** + * Required. ID of the `BuildTrigger` to update. + */ + // const triggerId = 'abc123' + /** + * Required. `BuildTrigger` to update. + */ + // const trigger = {} + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callUpdateBuildTrigger() { + // Construct request + const request = { + projectId, + triggerId, + trigger, + }; + + // Run request + const response = await cloudbuildClient.updateBuildTrigger(request); + console.log(response); + } + + callUpdateBuildTrigger(); + // [END cloudbuild_v1_generated_CloudBuild_UpdateBuildTrigger_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js new file mode 100644 index 000000000000..623087f8aba0 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/cloud_build.update_worker_pool.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workerPool) { + // [START cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_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 `WorkerPool` to update. + * The `name` field is used to identify the `WorkerPool` to update. + * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + */ + // const workerPool = {} + /** + * A mask specifying which fields in `worker_pool` to update. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the response, but do not actually + * post it. + */ + // const validateOnly = true + + // Imports the Cloudbuild library + const {CloudBuildClient} = require('@google-cloud/cloudbuild').v1; + + // Instantiates a client + const cloudbuildClient = new CloudBuildClient(); + + async function callUpdateWorkerPool() { + // Construct request + const request = { + workerPool, + }; + + // Run request + const [operation] = await cloudbuildClient.updateWorkerPool(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateWorkerPool(); + // [END cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-devtools-cloudbuild/samples/generated/v1/snippet_metadata.google.devtools.cloudbuild.v1.json b/packages/google-devtools-cloudbuild/samples/generated/v1/snippet_metadata.google.devtools.cloudbuild.v1.json new file mode 100644 index 000000000000..5e030fc31adf --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/generated/v1/snippet_metadata.google.devtools.cloudbuild.v1.json @@ -0,0 +1,899 @@ +{ + "clientLibrary": { + "name": "nodejs-cloudbuild", + "version": "3.2.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.devtools.cloudbuild.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_CreateBuild_async", + "title": "CloudBuild createBuild Sample", + "origin": "API_DEFINITION", + "description": " Starts a build with the specified configuration. This method returns a long-running `Operation`, which includes the build ID. Pass the build ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`).", + "canonical": true, + "file": "cloud_build.create_build.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CreateBuild", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "build", + "type": ".google.devtools.cloudbuild.v1.Build" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "CreateBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CreateBuild", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_GetBuild_async", + "title": "CloudBuild getBuild Sample", + "origin": "API_DEFINITION", + "description": " Returns information about a previously requested build. The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or `WORKING`), and timing information.", + "canonical": true, + "file": "cloud_build.get_build.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.GetBuild", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.Build", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "GetBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.GetBuild", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_ListBuilds_async", + "title": "CloudBuild listBuilds Sample", + "origin": "API_DEFINITION", + "description": " Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.", + "canonical": true, + "file": "cloud_build.list_builds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBuilds", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ListBuilds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.ListBuildsResponse", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "ListBuilds", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ListBuilds", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_CancelBuild_async", + "title": "CloudBuild cancelBuild Sample", + "origin": "API_DEFINITION", + "description": " Cancels a build in progress.", + "canonical": true, + "file": "cloud_build.cancel_build.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CancelBuild", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.Build", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "CancelBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CancelBuild", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_RetryBuild_async", + "title": "CloudBuild retryBuild Sample", + "origin": "API_DEFINITION", + "description": " Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify `RepoSource`: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify `StorageSource`: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.", + "canonical": true, + "file": "cloud_build.retry_build.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetryBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.RetryBuild", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "RetryBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.RetryBuild", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_ApproveBuild_async", + "title": "CloudBuild approveBuild Sample", + "origin": "API_DEFINITION", + "description": " Approves or rejects a pending build. If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call. If rejected, the returned LRO will be immediately done.", + "canonical": true, + "file": "cloud_build.approve_build.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ApproveBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ApproveBuild", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "approval_result", + "type": ".google.devtools.cloudbuild.v1.ApprovalResult" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "ApproveBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ApproveBuild", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async", + "title": "CloudBuild createBuildTrigger Sample", + "origin": "API_DEFINITION", + "description": " Creates a new `BuildTrigger`. This API is experimental.", + "canonical": true, + "file": "cloud_build.create_build_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CreateBuildTrigger", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger", + "type": ".google.devtools.cloudbuild.v1.BuildTrigger" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.BuildTrigger", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "CreateBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CreateBuildTrigger", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_GetBuildTrigger_async", + "title": "CloudBuild getBuildTrigger Sample", + "origin": "API_DEFINITION", + "description": " Returns information about a `BuildTrigger`. This API is experimental.", + "canonical": true, + "file": "cloud_build.get_build_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.GetBuildTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.BuildTrigger", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "GetBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.GetBuildTrigger", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_ListBuildTriggers_async", + "title": "CloudBuild listBuildTriggers Sample", + "origin": "API_DEFINITION", + "description": " Lists existing `BuildTrigger`s. This API is experimental.", + "canonical": true, + "file": "cloud_build.list_build_triggers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBuildTriggers", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ListBuildTriggers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.ListBuildTriggersResponse", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "ListBuildTriggers", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ListBuildTriggers", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_async", + "title": "CloudBuild deleteBuildTrigger Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental.", + "canonical": true, + "file": "cloud_build.delete_build_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.DeleteBuildTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "DeleteBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.DeleteBuildTrigger", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_UpdateBuildTrigger_async", + "title": "CloudBuild updateBuildTrigger Sample", + "origin": "API_DEFINITION", + "description": " Updates a `BuildTrigger` by its project ID and trigger ID. This API is experimental.", + "canonical": true, + "file": "cloud_build.update_build_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.UpdateBuildTrigger", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger", + "type": ".google.devtools.cloudbuild.v1.BuildTrigger" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.BuildTrigger", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "UpdateBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.UpdateBuildTrigger", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_async", + "title": "CloudBuild runBuildTrigger Sample", + "origin": "API_DEFINITION", + "description": " Runs a `BuildTrigger` at a particular source revision.", + "canonical": true, + "file": "cloud_build.run_build_trigger.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.RunBuildTrigger", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger_id", + "type": "TYPE_STRING" + }, + { + "name": "source", + "type": ".google.devtools.cloudbuild.v1.RepoSource" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "RunBuildTrigger", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.RunBuildTrigger", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_ReceiveTriggerWebhook_async", + "title": "CloudBuild receiveTriggerWebhook Sample", + "origin": "API_DEFINITION", + "description": " ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.", + "canonical": true, + "file": "cloud_build.receive_trigger_webhook.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReceiveTriggerWebhook", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ReceiveTriggerWebhook", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "body", + "type": ".google.api.HttpBody" + }, + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "trigger", + "type": "TYPE_STRING" + }, + { + "name": "secret", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "ReceiveTriggerWebhook", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ReceiveTriggerWebhook", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_async", + "title": "CloudBuild createWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Creates a `WorkerPool`.", + "canonical": true, + "file": "cloud_build.create_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPool", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "worker_pool", + "type": ".google.devtools.cloudbuild.v1.WorkerPool" + }, + { + "name": "worker_pool_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "CreateWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPool", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_GetWorkerPool_async", + "title": "CloudBuild getWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Returns details of a `WorkerPool`.", + "canonical": true, + "file": "cloud_build.get_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.GetWorkerPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.WorkerPool", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "GetWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.GetWorkerPool", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_async", + "title": "CloudBuild deleteWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `WorkerPool`.", + "canonical": true, + "file": "cloud_build.delete_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPool", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "DeleteWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPool", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_async", + "title": "CloudBuild updateWorkerPool Sample", + "origin": "API_DEFINITION", + "description": " Updates a `WorkerPool`.", + "canonical": true, + "file": "cloud_build.update_worker_pool.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPool", + "async": true, + "parameters": [ + { + "name": "worker_pool", + "type": ".google.devtools.cloudbuild.v1.WorkerPool" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "UpdateWorkerPool", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPool", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + }, + { + "regionTag": "cloudbuild_v1_generated_CloudBuild_ListWorkerPools_async", + "title": "CloudBuild listWorkerPools Sample", + "origin": "API_DEFINITION", + "description": " Lists `WorkerPool`s.", + "canonical": true, + "file": "cloud_build.list_worker_pools.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkerPools", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ListWorkerPools", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse", + "client": { + "shortName": "CloudBuildClient", + "fullName": "google.devtools.cloudbuild.v1.CloudBuildClient" + }, + "method": { + "shortName": "ListWorkerPools", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild.ListWorkerPools", + "service": { + "shortName": "CloudBuild", + "fullName": "google.devtools.cloudbuild.v1.CloudBuild" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-devtools-cloudbuild/samples/package.json b/packages/google-devtools-cloudbuild/samples/package.json new file mode 100644 index 000000000000..fb8fa2576085 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/package.json @@ -0,0 +1,25 @@ +{ + "name": "nodejs-cloudbuild-samples", + "private": true, + "license": "Apache-2.0", + "files": [ + "*.js", + "resources" + ], + "author": "Google Inc.", + "repository": "googleapis/nodejs-cloudbuild", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "test": "c8 mocha system-test --timeout=800000" + }, + "dependencies": { + "@google-cloud/cloudbuild": "^3.2.0" + }, + "devDependencies": { + "c8": "^7.0.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-devtools-cloudbuild/samples/quickstart.js b/packages/google-devtools-cloudbuild/samples/quickstart.js new file mode 100644 index 000000000000..b1a3fb2a23d3 --- /dev/null +++ b/packages/google-devtools-cloudbuild/samples/quickstart.js @@ -0,0 +1,66 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +// [START cloudbuild_quickstart] +async function quickstart( + projectId = 'YOUR_PROJECT_ID', // Your Google Cloud Platform project ID + triggerId = 'YOUR_TRIGGER_ID', // UUID for build trigger. + branchName = 'BRANCH_TO_BUILD' // Branch to run build against. +) { + // Imports the Google Cloud client library + const {CloudBuildClient} = require('@google-cloud/cloudbuild'); + + // Creates a client + const cb = new CloudBuildClient(); + + // Note: for Private Pools, you'll have to specify an API endpoint value + // For example: + // const cb = new CloudBuildClient({ apiEndpoint: '-cloudbuild.googleapis.com' }); + + // Starts a build against the branch provided. + const [resp] = await cb.runBuildTrigger({ + projectId, + triggerId, + source: { + projectId, + dir: './', + branchName, + }, + }); + console.info(`triggered build for ${triggerId}`); + const [build] = await resp.promise(); + + const STATUS_LOOKUP = [ + 'UNKNOWN', + 'Queued', + 'Working', + 'Success', + 'Failure', + 'Error', + 'Timeout', + 'Cancelled', + ]; + for (const step of build.steps) { + console.info( + `step:\n\tname: ${step.name}\n\tstatus: ${STATUS_LOOKUP[build.status]}` + ); + } +} +// [END cloudbuild_quickstart] + +const args = process.argv.slice(2); +quickstart(...args).catch(console.error); diff --git a/packages/google-devtools-cloudbuild/src/index.ts b/packages/google-devtools-cloudbuild/src/index.ts new file mode 100644 index 000000000000..878b23339290 --- /dev/null +++ b/packages/google-devtools-cloudbuild/src/index.ts @@ -0,0 +1,27 @@ +// 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 v1 from './v1'; + +const CloudBuildClient = v1.CloudBuildClient; +type CloudBuildClient = v1.CloudBuildClient; + +export {v1, CloudBuildClient}; +export default {v1, CloudBuildClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts new file mode 100644 index 000000000000..5fcf1cfcd576 --- /dev/null +++ b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client.ts @@ -0,0 +1,3584 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/cloud_build_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_build_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Creates and manages builds on Google Cloud Platform. + * + * The main concept used by this API is a `Build`, which describes the location + * of the source to build, how to build the source, and where to store the + * built artifacts, if any. + * + * A user can list previously-requested builds or get builds by their ID to + * determine the status of the build. + * @class + * @memberof v1 + */ +export class CloudBuildClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + cloudBuildStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudBuildClient. + * + * @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 CloudBuildClient({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 CloudBuildClient; + 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 = { + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectBuildPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/builds/{build}' + ), + projectLocationBuildPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/builds/{build}' + ), + projectLocationTriggerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/triggers/{trigger}' + ), + projectTriggerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/triggers/{trigger}' + ), + secretVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/secrets/{secret}/versions/{version}' + ), + serviceAccountPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/serviceAccounts/{service_account}' + ), + subscriptionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/subscriptions/{subscription}' + ), + topicPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/topics/{topic}' + ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), + }; + + // 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 = { + listBuilds: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'builds' + ), + listBuildTriggers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'triggers' + ), + listWorkerPools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workerPools' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=operations/**}:cancel', + body: '*', + additional_bindings: [ + { + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=operations/**}', + additional_bindings: [ + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createBuildResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.Build' + ) as gax.protobuf.Type; + const createBuildMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.BuildOperationMetadata' + ) as gax.protobuf.Type; + const retryBuildResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.Build' + ) as gax.protobuf.Type; + const retryBuildMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.BuildOperationMetadata' + ) as gax.protobuf.Type; + const approveBuildResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.Build' + ) as gax.protobuf.Type; + const approveBuildMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.BuildOperationMetadata' + ) as gax.protobuf.Type; + const runBuildTriggerResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.Build' + ) as gax.protobuf.Type; + const runBuildTriggerMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.BuildOperationMetadata' + ) as gax.protobuf.Type; + const createWorkerPoolResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.WorkerPool' + ) as gax.protobuf.Type; + const createWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata' + ) as gax.protobuf.Type; + const deleteWorkerPoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata' + ) as gax.protobuf.Type; + const updateWorkerPoolResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.WorkerPool' + ) as gax.protobuf.Type; + const updateWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createBuild: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBuildResponse.decode.bind(createBuildResponse), + createBuildMetadata.decode.bind(createBuildMetadata) + ), + retryBuild: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + retryBuildResponse.decode.bind(retryBuildResponse), + retryBuildMetadata.decode.bind(retryBuildMetadata) + ), + approveBuild: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + approveBuildResponse.decode.bind(approveBuildResponse), + approveBuildMetadata.decode.bind(approveBuildMetadata) + ), + runBuildTrigger: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + runBuildTriggerResponse.decode.bind(runBuildTriggerResponse), + runBuildTriggerMetadata.decode.bind(runBuildTriggerMetadata) + ), + createWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkerPoolResponse.decode.bind(createWorkerPoolResponse), + createWorkerPoolMetadata.decode.bind(createWorkerPoolMetadata) + ), + deleteWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkerPoolResponse.decode.bind(deleteWorkerPoolResponse), + deleteWorkerPoolMetadata.decode.bind(deleteWorkerPoolMetadata) + ), + updateWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkerPoolResponse.decode.bind(updateWorkerPoolResponse), + updateWorkerPoolMetadata.decode.bind(updateWorkerPoolMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.devtools.cloudbuild.v1.CloudBuild', + 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.cloudBuildStub) { + return this.cloudBuildStub; + } + + // Put together the "service stub" for + // google.devtools.cloudbuild.v1.CloudBuild. + this.cloudBuildStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.devtools.cloudbuild.v1.CloudBuild' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.devtools.cloudbuild.v1.CloudBuild, + 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 cloudBuildStubMethods = [ + 'createBuild', + 'getBuild', + 'listBuilds', + 'cancelBuild', + 'retryBuild', + 'approveBuild', + 'createBuildTrigger', + 'getBuildTrigger', + 'listBuildTriggers', + 'deleteBuildTrigger', + 'updateBuildTrigger', + 'runBuildTrigger', + 'receiveTriggerWebhook', + 'createWorkerPool', + 'getWorkerPool', + 'deleteWorkerPool', + 'updateWorkerPool', + 'listWorkerPools', + ]; + for (const methodName of cloudBuildStubMethods) { + const callPromise = this.cloudBuildStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.cloudBuildStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'cloudbuild.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 'cloudbuild.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 -- + // ------------------- + /** + * Returns information about a previously requested build. + * + * The `Build` that is returned includes its status (such as `SUCCESS`, + * `FAILURE`, or `WORKING`), and timing information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `Build` to retrieve. + * Format: `projects/{project}/locations/{location}/builds/{build}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {string} request.id + * Required. ID of the build. + * @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 [Build]{@link google.devtools.cloudbuild.v1.Build}. + * 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/v1/cloud_build.get_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_GetBuild_async + */ + getBuild( + request?: protos.google.devtools.cloudbuild.v1.IGetBuildRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IGetBuildRequest | undefined, + {} | undefined + ] + >; + getBuild( + request: protos.google.devtools.cloudbuild.v1.IGetBuildRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IGetBuildRequest | null | undefined, + {} | null | undefined + > + ): void; + getBuild( + request: protos.google.devtools.cloudbuild.v1.IGetBuildRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IGetBuildRequest | null | undefined, + {} | null | undefined + > + ): void; + getBuild( + request?: protos.google.devtools.cloudbuild.v1.IGetBuildRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + | protos.google.devtools.cloudbuild.v1.IGetBuildRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IGetBuildRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IGetBuildRequest | 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({ + project_id: request.projectId ?? '', + id: request.id ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getBuild(request, options, callback); + } + /** + * Cancels a build in progress. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `Build` to cancel. + * Format: `projects/{project}/locations/{location}/builds/{build}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {string} request.id + * Required. ID of the build. + * @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 [Build]{@link google.devtools.cloudbuild.v1.Build}. + * 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/v1/cloud_build.cancel_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_CancelBuild_async + */ + cancelBuild( + request?: protos.google.devtools.cloudbuild.v1.ICancelBuildRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.ICancelBuildRequest | undefined, + {} | undefined + ] + >; + cancelBuild( + request: protos.google.devtools.cloudbuild.v1.ICancelBuildRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + | protos.google.devtools.cloudbuild.v1.ICancelBuildRequest + | null + | undefined, + {} | null | undefined + > + ): void; + cancelBuild( + request: protos.google.devtools.cloudbuild.v1.ICancelBuildRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + | protos.google.devtools.cloudbuild.v1.ICancelBuildRequest + | null + | undefined, + {} | null | undefined + > + ): void; + cancelBuild( + request?: protos.google.devtools.cloudbuild.v1.ICancelBuildRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + | protos.google.devtools.cloudbuild.v1.ICancelBuildRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IBuild, + | protos.google.devtools.cloudbuild.v1.ICancelBuildRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.ICancelBuildRequest | 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({ + project_id: request.projectId ?? '', + id: request.id ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.cancelBuild(request, options, callback); + } + /** + * Creates a new `BuildTrigger`. + * + * This API is experimental. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent resource where this trigger will be created. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.projectId + * Required. ID of the project for which to configure automatic builds. + * @param {google.devtools.cloudbuild.v1.BuildTrigger} request.trigger + * Required. `BuildTrigger` to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BuildTrigger]{@link google.devtools.cloudbuild.v1.BuildTrigger}. + * 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/v1/cloud_build.create_build_trigger.js + * region_tag:cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_async + */ + createBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + ( + | protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest + | undefined + ), + {} | undefined + ] + >; + createBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + ( + | protos.google.devtools.cloudbuild.v1.ICreateBuildTriggerRequest + | 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createBuildTrigger(request, options, callback); + } + /** + * Returns information about a `BuildTrigger`. + * + * This API is experimental. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `Trigger` to retrieve. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + * @param {string} request.projectId + * Required. ID of the project that owns the trigger. + * @param {string} request.triggerId + * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. + * @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 [BuildTrigger]{@link google.devtools.cloudbuild.v1.BuildTrigger}. + * 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/v1/cloud_build.get_build_trigger.js + * region_tag:cloudbuild_v1_generated_CloudBuild_GetBuildTrigger_async + */ + getBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest | undefined, + {} | undefined + ] + >; + getBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + protos.google.devtools.cloudbuild.v1.IGetBuildTriggerRequest | 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({ + project_id: request.projectId ?? '', + trigger_id: request.triggerId ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getBuildTrigger(request, options, callback); + } + /** + * Deletes a `BuildTrigger` by its project ID and trigger ID. + * + * This API is experimental. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `Trigger` to delete. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + * @param {string} request.projectId + * Required. ID of the project that owns the trigger. + * @param {string} request.triggerId + * Required. ID of the `BuildTrigger` to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [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/v1/cloud_build.delete_build_trigger.js + * region_tag:cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_async + */ + deleteBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest + | undefined + ), + {} | undefined + ] + >; + deleteBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.devtools.cloudbuild.v1.IDeleteBuildTriggerRequest + | 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({ + project_id: request.projectId ?? '', + trigger_id: request.triggerId ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBuildTrigger(request, options, callback); + } + /** + * Updates a `BuildTrigger` by its project ID and trigger ID. + * + * This API is experimental. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. ID of the project that owns the trigger. + * @param {string} request.triggerId + * Required. ID of the `BuildTrigger` to update. + * @param {google.devtools.cloudbuild.v1.BuildTrigger} request.trigger + * Required. `BuildTrigger` to update. + * @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 [BuildTrigger]{@link google.devtools.cloudbuild.v1.BuildTrigger}. + * 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/v1/cloud_build.update_build_trigger.js + * region_tag:cloudbuild_v1_generated_CloudBuild_UpdateBuildTrigger_async + */ + updateBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + ( + | protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest + | undefined + ), + {} | undefined + ] + >; + updateBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + | protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger, + ( + | protos.google.devtools.cloudbuild.v1.IUpdateBuildTriggerRequest + | 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({ + project_id: request.projectId ?? '', + trigger_id: request.triggerId ?? '', + 'trigger.resource_name': request.trigger!.resourceName ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBuildTrigger(request, options, callback); + } + /** + * ReceiveTriggerWebhook [Experimental] is called when the API receives a + * webhook request targeted at a specific trigger. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `ReceiveTriggerWebhook` to retrieve. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + * @param {google.api.HttpBody} request.body + * HTTP request body. + * @param {string} request.projectId + * Project in which the specified trigger lives + * @param {string} request.trigger + * Name of the trigger to run the payload against + * @param {string} request.secret + * Secret token used for authorization if an OAuth token isn't provided. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReceiveTriggerWebhookResponse]{@link google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse}. + * 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/v1/cloud_build.receive_trigger_webhook.js + * region_tag:cloudbuild_v1_generated_CloudBuild_ReceiveTriggerWebhook_async + */ + receiveTriggerWebhook( + request?: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + ( + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | undefined + ), + {} | undefined + ] + >; + receiveTriggerWebhook( + request: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + > + ): void; + receiveTriggerWebhook( + request: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + > + ): void; + receiveTriggerWebhook( + request?: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse, + ( + | protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookRequest + | 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({ + project_id: request.projectId ?? '', + trigger: request.trigger ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.receiveTriggerWebhook(request, options, callback); + } + /** + * Returns details of a `WorkerPool`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `WorkerPool` to retrieve. + * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + * @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 [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. + * 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/v1/cloud_build.get_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_GetWorkerPool_async + */ + getWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest | undefined, + {} | undefined + ] + >; + getWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + | protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, + callback: Callback< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + | protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + | protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + | protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest | 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.getWorkerPool(request, options, callback); + } + + /** + * Starts a build with the specified configuration. + * + * This method returns a long-running `Operation`, which includes the build + * ID. Pass the build ID to `GetBuild` to determine the build status (such as + * `SUCCESS` or `FAILURE`). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent resource where this build will be created. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {google.devtools.cloudbuild.v1.Build} request.build + * Required. Build resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.create_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_CreateBuild_async + */ + createBuild( + request?: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createBuild( + request: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBuild( + request: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBuild( + request?: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createBuild(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBuild()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.create_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_CreateBuild_async + */ + async checkCreateBuildProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBuild, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + /** + * Creates a new build based on the specified build. + * + * This method creates a new build using the original build request, which may + * or may not result in an identical build. + * + * For triggered builds: + * + * * Triggered builds resolve to a precise revision; therefore a retry of a + * triggered build will result in a build that uses the same revision. + * + * For non-triggered builds that specify `RepoSource`: + * + * * If the original build built from the tip of a branch, the retried build + * will build from the tip of that branch, which may not be the same revision + * as the original build. + * * If the original build specified a commit sha or revision ID, the retried + * build will use the identical source. + * + * For builds that specify `StorageSource`: + * + * * If the original build pulled source from Google Cloud Storage without + * specifying the generation of the object, the new build will use the current + * object, which may be different from the original build source. + * * If the original build pulled source from Cloud Storage and specified the + * generation of the object, the new build will attempt to use the same + * object, which may or may not be available depending on the bucket's + * lifecycle management settings. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `Build` to retry. + * Format: `projects/{project}/locations/{location}/builds/{build}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {string} request.id + * Required. Build ID of the original build. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.retry_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_RetryBuild_async + */ + retryBuild( + request?: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + retryBuild( + request: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + retryBuild( + request: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + retryBuild( + request?: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + id: request.id ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.retryBuild(request, options, callback); + } + /** + * Check the status of the long running operation returned by `retryBuild()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.retry_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_RetryBuild_async + */ + async checkRetryBuildProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.retryBuild, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + /** + * Approves or rejects a pending build. + * + * If approved, the returned LRO will be analogous to the LRO returned from + * a CreateBuild call. + * + * If rejected, the returned LRO will be immediately done. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the target build. + * For example: "projects/{$project_id}/builds/{$build_id}" + * @param {google.devtools.cloudbuild.v1.ApprovalResult} request.approvalResult + * Approval decision and metadata. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.approve_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_ApproveBuild_async + */ + approveBuild( + request?: protos.google.devtools.cloudbuild.v1.IApproveBuildRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + approveBuild( + request: protos.google.devtools.cloudbuild.v1.IApproveBuildRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + approveBuild( + request: protos.google.devtools.cloudbuild.v1.IApproveBuildRequest, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + approveBuild( + request?: protos.google.devtools.cloudbuild.v1.IApproveBuildRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.approveBuild(request, options, callback); + } + /** + * Check the status of the long running operation returned by `approveBuild()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.approve_build.js + * region_tag:cloudbuild_v1_generated_CloudBuild_ApproveBuild_async + */ + async checkApproveBuildProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.approveBuild, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + /** + * Runs a `BuildTrigger` at a particular source revision. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The name of the `Trigger` to run. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {string} request.triggerId + * Required. ID of the trigger. + * @param {google.devtools.cloudbuild.v1.RepoSource} request.source + * Source to build against this trigger. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.run_build_trigger.js + * region_tag:cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_async + */ + runBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + runBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + runBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + project_id: request.projectId ?? '', + trigger_id: request.triggerId ?? '', + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.runBuildTrigger(request, options, callback); + } + /** + * Check the status of the long running operation returned by `runBuildTrigger()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.run_build_trigger.js + * region_tag:cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_async + */ + async checkRunBuildTriggerProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.runBuildTrigger, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + /** + * Creates a `WorkerPool`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this worker pool will be created. + * Format: `projects/{project}/locations/{location}`. + * @param {google.devtools.cloudbuild.v1.WorkerPool} request.workerPool + * Required. `WorkerPool` resource to create. + * @param {string} request.workerPoolId + * Required. Immutable. The ID to use for the `WorkerPool`, which will become + * the final component of the resource name. + * + * This value should be 1-63 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the response, but do not actually + * post it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.create_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_async + */ + createWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkerPool( + request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkerPool( + request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createWorkerPool(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createWorkerPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.create_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_async + */ + async checkCreateWorkerPoolProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createWorkerPool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + >; + } + /** + * Deletes a `WorkerPool`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `WorkerPool` to delete. + * Format: + * `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`. + * @param {string} request.etag + * Optional. If this is provided, it must match the server's etag on the + * workerpool for the request to be processed. + * @param {boolean} request.allowMissing + * If set to true, and the `WorkerPool` is not found, the request will succeed + * but no action will be taken on the server. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the response, but do not actually + * post it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.delete_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_async + */ + deleteWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkerPool(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteWorkerPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.delete_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_async + */ + async checkDeleteWorkerPoolProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteWorkerPool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + >; + } + /** + * Updates a `WorkerPool`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.devtools.cloudbuild.v1.WorkerPool} request.workerPool + * Required. The `WorkerPool` to update. + * + * The `name` field is used to identify the `WorkerPool` to update. + * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + * @param {google.protobuf.FieldMask} request.updateMask + * A mask specifying which fields in `worker_pool` to update. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the response, but do not actually + * post it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.update_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_async + */ + updateWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + callback: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'worker_pool.name': request.workerPool!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkerPool(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateWorkerPool()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_build.update_worker_pool.js + * region_tag:cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_async + */ + async checkUpdateWorkerPoolProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateWorkerPool, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + >; + } + /** + * Lists previously requested builds. + * + * Previously requested builds may still be in-progress, or may have finished + * successfully or unsuccessfully. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` + * @param {string} request.projectId + * Required. ID of the project. + * @param {number} request.pageSize + * Number of results to return in the list. + * @param {string} request.pageToken + * The page token for the next page of Builds. + * + * If unspecified, the first page of results is returned. + * + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * + * See https://google.aip.dev/158 for more. + * @param {string} request.filter + * The raw filter text to constrain the results. + * @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 [Build]{@link google.devtools.cloudbuild.v1.Build}. + * 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 `listBuildsAsync()` + * 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. + */ + listBuilds( + request?: protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuild[], + protos.google.devtools.cloudbuild.v1.IListBuildsRequest | null, + protos.google.devtools.cloudbuild.v1.IListBuildsResponse + ] + >; + listBuilds( + request: protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuild + > + ): void; + listBuilds( + request: protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuild + > + ): void; + listBuilds( + request?: protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuild + >, + callback?: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuild + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuild[], + protos.google.devtools.cloudbuild.v1.IListBuildsRequest | null, + protos.google.devtools.cloudbuild.v1.IListBuildsResponse + ] + > | 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listBuilds(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 + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` + * @param {string} request.projectId + * Required. ID of the project. + * @param {number} request.pageSize + * Number of results to return in the list. + * @param {string} request.pageToken + * The page token for the next page of Builds. + * + * If unspecified, the first page of results is returned. + * + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * + * See https://google.aip.dev/158 for more. + * @param {string} request.filter + * The raw filter text to constrain the results. + * @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 [Build]{@link google.devtools.cloudbuild.v1.Build} 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 `listBuildsAsync()` + * 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. + */ + listBuildsStream( + request?: protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBuilds']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBuilds.createStream( + this.innerApiCalls.listBuilds as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBuilds`, 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 + * The parent of the collection of `Builds`. + * Format: `projects/{project}/locations/location` + * @param {string} request.projectId + * Required. ID of the project. + * @param {number} request.pageSize + * Number of results to return in the list. + * @param {string} request.pageToken + * The page token for the next page of Builds. + * + * If unspecified, the first page of results is returned. + * + * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. + * In this case, the token should be discarded, and pagination should be + * restarted from the first page of results. + * + * See https://google.aip.dev/158 for more. + * @param {string} request.filter + * The raw filter text to constrain the results. + * @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 + * [Build]{@link google.devtools.cloudbuild.v1.Build}. 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/v1/cloud_build.list_builds.js + * region_tag:cloudbuild_v1_generated_CloudBuild_ListBuilds_async + */ + listBuildsAsync( + request?: protos.google.devtools.cloudbuild.v1.IListBuildsRequest, + 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBuilds']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBuilds.asyncIterate( + this.innerApiCalls['listBuilds'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists existing `BuildTrigger`s. + * + * This API is experimental. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The parent of the collection of `Triggers`. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.projectId + * Required. ID of the project for which to list BuildTriggers. + * @param {number} request.pageSize + * Number of results to return in the list. + * @param {string} request.pageToken + * Token to provide to skip to a particular spot in the list. + * @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 [BuildTrigger]{@link google.devtools.cloudbuild.v1.BuildTrigger}. + * 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 `listBuildTriggersAsync()` + * 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. + */ + listBuildTriggers( + request?: protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger[], + protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest | null, + protos.google.devtools.cloudbuild.v1.IListBuildTriggersResponse + ] + >; + listBuildTriggers( + request: protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildTriggersResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuildTrigger + > + ): void; + listBuildTriggers( + request: protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildTriggersResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuildTrigger + > + ): void; + listBuildTriggers( + request?: protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildTriggersResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuildTrigger + >, + callback?: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + | protos.google.devtools.cloudbuild.v1.IListBuildTriggersResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IBuildTrigger + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IBuildTrigger[], + protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest | null, + protos.google.devtools.cloudbuild.v1.IListBuildTriggersResponse + ] + > | 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listBuildTriggers(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 + * The parent of the collection of `Triggers`. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.projectId + * Required. ID of the project for which to list BuildTriggers. + * @param {number} request.pageSize + * Number of results to return in the list. + * @param {string} request.pageToken + * Token to provide to skip to a particular spot in the list. + * @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 [BuildTrigger]{@link google.devtools.cloudbuild.v1.BuildTrigger} 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 `listBuildTriggersAsync()` + * 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. + */ + listBuildTriggersStream( + request?: protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBuildTriggers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBuildTriggers.createStream( + this.innerApiCalls.listBuildTriggers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBuildTriggers`, 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 + * The parent of the collection of `Triggers`. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.projectId + * Required. ID of the project for which to list BuildTriggers. + * @param {number} request.pageSize + * Number of results to return in the list. + * @param {string} request.pageToken + * Token to provide to skip to a particular spot in the list. + * @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 + * [BuildTrigger]{@link google.devtools.cloudbuild.v1.BuildTrigger}. 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/v1/cloud_build.list_build_triggers.js + * region_tag:cloudbuild_v1_generated_CloudBuild_ListBuildTriggers_async + */ + listBuildTriggersAsync( + request?: protos.google.devtools.cloudbuild.v1.IListBuildTriggersRequest, + 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({ + project_id: request.projectId ?? '', + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBuildTriggers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBuildTriggers.asyncIterate( + this.innerApiCalls['listBuildTriggers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists `WorkerPool`s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + * @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 [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. + * 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 `listWorkerPoolsAsync()` + * 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. + */ + listWorkerPools( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IWorkerPool[], + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest | null, + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + ] + >; + listWorkerPools( + request: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + > + ): void; + listWorkerPools( + request: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + > + ): void; + listWorkerPools( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + >, + callback?: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IWorkerPool[], + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest | null, + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + ] + > | 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.listWorkerPools(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 parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + * @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 [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool} 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 `listWorkerPoolsAsync()` + * 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. + */ + listWorkerPoolsStream( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + 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['listWorkerPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkerPools.createStream( + this.innerApiCalls.listWorkerPools as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkerPools`, 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 parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + * @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 + * [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. 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/v1/cloud_build.list_worker_pools.js + * region_tag:cloudbuild_v1_generated_CloudBuild_ListWorkerPools_async + */ + listWorkerPoolsAsync( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + 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['listWorkerPools']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkerPools.asyncIterate( + this.innerApiCalls['listWorkerPools'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} keyring + * @param {string} key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyring: string, + key: string + ) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + keyring: keyring, + key: key, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the keyring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the keyring. + */ + matchKeyringFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .keyring; + } + + /** + * Parse the key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key. + */ + matchKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key; + } + + /** + * 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 projectBuild resource name string. + * + * @param {string} project + * @param {string} build + * @returns {string} Resource name string. + */ + projectBuildPath(project: string, build: string) { + return this.pathTemplates.projectBuildPathTemplate.render({ + project: project, + build: build, + }); + } + + /** + * Parse the project from ProjectBuild resource. + * + * @param {string} projectBuildName + * A fully-qualified path representing project_build resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectBuildName(projectBuildName: string) { + return this.pathTemplates.projectBuildPathTemplate.match(projectBuildName) + .project; + } + + /** + * Parse the build from ProjectBuild resource. + * + * @param {string} projectBuildName + * A fully-qualified path representing project_build resource. + * @returns {string} A string representing the build. + */ + matchBuildFromProjectBuildName(projectBuildName: string) { + return this.pathTemplates.projectBuildPathTemplate.match(projectBuildName) + .build; + } + + /** + * Return a fully-qualified projectLocationBuild resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} build + * @returns {string} Resource name string. + */ + projectLocationBuildPath(project: string, location: string, build: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.render({ + project: project, + location: location, + build: build, + }); + } + + /** + * Parse the project from ProjectLocationBuild resource. + * + * @param {string} projectLocationBuildName + * A fully-qualified path representing project_location_build resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationBuildName(projectLocationBuildName: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.match( + projectLocationBuildName + ).project; + } + + /** + * Parse the location from ProjectLocationBuild resource. + * + * @param {string} projectLocationBuildName + * A fully-qualified path representing project_location_build resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationBuildName(projectLocationBuildName: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.match( + projectLocationBuildName + ).location; + } + + /** + * Parse the build from ProjectLocationBuild resource. + * + * @param {string} projectLocationBuildName + * A fully-qualified path representing project_location_build resource. + * @returns {string} A string representing the build. + */ + matchBuildFromProjectLocationBuildName(projectLocationBuildName: string) { + return this.pathTemplates.projectLocationBuildPathTemplate.match( + projectLocationBuildName + ).build; + } + + /** + * Return a fully-qualified projectLocationTrigger resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} trigger + * @returns {string} Resource name string. + */ + projectLocationTriggerPath( + project: string, + location: string, + trigger: string + ) { + return this.pathTemplates.projectLocationTriggerPathTemplate.render({ + project: project, + location: location, + trigger: trigger, + }); + } + + /** + * Parse the project from ProjectLocationTrigger resource. + * + * @param {string} projectLocationTriggerName + * A fully-qualified path representing project_location_trigger resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationTriggerName( + projectLocationTriggerName: string + ) { + return this.pathTemplates.projectLocationTriggerPathTemplate.match( + projectLocationTriggerName + ).project; + } + + /** + * Parse the location from ProjectLocationTrigger resource. + * + * @param {string} projectLocationTriggerName + * A fully-qualified path representing project_location_trigger resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationTriggerName( + projectLocationTriggerName: string + ) { + return this.pathTemplates.projectLocationTriggerPathTemplate.match( + projectLocationTriggerName + ).location; + } + + /** + * Parse the trigger from ProjectLocationTrigger resource. + * + * @param {string} projectLocationTriggerName + * A fully-qualified path representing project_location_trigger resource. + * @returns {string} A string representing the trigger. + */ + matchTriggerFromProjectLocationTriggerName( + projectLocationTriggerName: string + ) { + return this.pathTemplates.projectLocationTriggerPathTemplate.match( + projectLocationTriggerName + ).trigger; + } + + /** + * Return a fully-qualified projectTrigger resource name string. + * + * @param {string} project + * @param {string} trigger + * @returns {string} Resource name string. + */ + projectTriggerPath(project: string, trigger: string) { + return this.pathTemplates.projectTriggerPathTemplate.render({ + project: project, + trigger: trigger, + }); + } + + /** + * Parse the project from ProjectTrigger resource. + * + * @param {string} projectTriggerName + * A fully-qualified path representing project_trigger resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectTriggerName(projectTriggerName: string) { + return this.pathTemplates.projectTriggerPathTemplate.match( + projectTriggerName + ).project; + } + + /** + * Parse the trigger from ProjectTrigger resource. + * + * @param {string} projectTriggerName + * A fully-qualified path representing project_trigger resource. + * @returns {string} A string representing the trigger. + */ + matchTriggerFromProjectTriggerName(projectTriggerName: string) { + return this.pathTemplates.projectTriggerPathTemplate.match( + projectTriggerName + ).trigger; + } + + /** + * Return a fully-qualified secretVersion resource name string. + * + * @param {string} project + * @param {string} secret + * @param {string} version + * @returns {string} Resource name string. + */ + secretVersionPath(project: string, secret: string, version: string) { + return this.pathTemplates.secretVersionPathTemplate.render({ + project: project, + secret: secret, + version: version, + }); + } + + /** + * Parse the project from SecretVersion resource. + * + * @param {string} secretVersionName + * A fully-qualified path representing SecretVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSecretVersionName(secretVersionName: string) { + return this.pathTemplates.secretVersionPathTemplate.match(secretVersionName) + .project; + } + + /** + * Parse the secret from SecretVersion resource. + * + * @param {string} secretVersionName + * A fully-qualified path representing SecretVersion resource. + * @returns {string} A string representing the secret. + */ + matchSecretFromSecretVersionName(secretVersionName: string) { + return this.pathTemplates.secretVersionPathTemplate.match(secretVersionName) + .secret; + } + + /** + * Parse the version from SecretVersion resource. + * + * @param {string} secretVersionName + * A fully-qualified path representing SecretVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromSecretVersionName(secretVersionName: string) { + return this.pathTemplates.secretVersionPathTemplate.match(secretVersionName) + .version; + } + + /** + * Return a fully-qualified serviceAccount resource name string. + * + * @param {string} project + * @param {string} service_account + * @returns {string} Resource name string. + */ + serviceAccountPath(project: string, serviceAccount: string) { + return this.pathTemplates.serviceAccountPathTemplate.render({ + project: project, + service_account: serviceAccount, + }); + } + + /** + * Parse the project from ServiceAccount resource. + * + * @param {string} serviceAccountName + * A fully-qualified path representing ServiceAccount resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceAccountName(serviceAccountName: string) { + return this.pathTemplates.serviceAccountPathTemplate.match( + serviceAccountName + ).project; + } + + /** + * Parse the service_account from ServiceAccount resource. + * + * @param {string} serviceAccountName + * A fully-qualified path representing ServiceAccount resource. + * @returns {string} A string representing the service_account. + */ + matchServiceAccountFromServiceAccountName(serviceAccountName: string) { + return this.pathTemplates.serviceAccountPathTemplate.match( + serviceAccountName + ).service_account; + } + + /** + * Return a fully-qualified subscription resource name string. + * + * @param {string} project + * @param {string} subscription + * @returns {string} Resource name string. + */ + subscriptionPath(project: string, subscription: string) { + return this.pathTemplates.subscriptionPathTemplate.render({ + project: project, + subscription: subscription, + }); + } + + /** + * Parse the project from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .project; + } + + /** + * Parse the subscription from Subscription resource. + * + * @param {string} subscriptionName + * A fully-qualified path representing Subscription resource. + * @returns {string} A string representing the subscription. + */ + matchSubscriptionFromSubscriptionName(subscriptionName: string) { + return this.pathTemplates.subscriptionPathTemplate.match(subscriptionName) + .subscription; + } + + /** + * Return a fully-qualified topic resource name string. + * + * @param {string} project + * @param {string} topic + * @returns {string} Resource name string. + */ + topicPath(project: string, topic: string) { + return this.pathTemplates.topicPathTemplate.render({ + project: project, + topic: topic, + }); + } + + /** + * Parse the project from Topic resource. + * + * @param {string} topicName + * A fully-qualified path representing Topic resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTopicName(topicName: string) { + return this.pathTemplates.topicPathTemplate.match(topicName).project; + } + + /** + * Parse the topic from Topic resource. + * + * @param {string} topicName + * A fully-qualified path representing Topic resource. + * @returns {string} A string representing the topic. + */ + matchTopicFromTopicName(topicName: string) { + return this.pathTemplates.topicPathTemplate.match(topicName).topic; + } + + /** + * Return a fully-qualified workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project: string, location: string, workerPool: string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .worker_pool; + } + + /** + * 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.cloudBuildStub && !this._terminated) { + return this.cloudBuildStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json new file mode 100644 index 000000000000..c677cba6cb74 --- /dev/null +++ b/packages/google-devtools-cloudbuild/src/v1/cloud_build_client_config.json @@ -0,0 +1,114 @@ +{ + "interfaces": { + "google.devtools.cloudbuild.v1.CloudBuild": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateBuild": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBuild": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListBuilds": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CancelBuild": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RetryBuild": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApproveBuild": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBuildTrigger": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBuildTrigger": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListBuildTriggers": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteBuildTrigger": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateBuildTrigger": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RunBuildTrigger": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReceiveTriggerWebhook": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateWorkerPool": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkerPool": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteWorkerPool": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkerPool": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkerPools": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-devtools-cloudbuild/src/v1/cloud_build_proto_list.json b/packages/google-devtools-cloudbuild/src/v1/cloud_build_proto_list.json new file mode 100644 index 000000000000..ef522572f3bc --- /dev/null +++ b/packages/google-devtools-cloudbuild/src/v1/cloud_build_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/devtools/cloudbuild/v1/cloudbuild.proto" +] diff --git a/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json b/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..33226421337b --- /dev/null +++ b/packages/google-devtools-cloudbuild/src/v1/gapic_metadata.json @@ -0,0 +1,215 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.devtools.cloudbuild.v1", + "libraryPackage": "@google-cloud/cloudbuild", + "services": { + "CloudBuild": { + "clients": { + "grpc": { + "libraryClient": "CloudBuildClient", + "rpcs": { + "GetBuild": { + "methods": [ + "getBuild" + ] + }, + "CancelBuild": { + "methods": [ + "cancelBuild" + ] + }, + "CreateBuildTrigger": { + "methods": [ + "createBuildTrigger" + ] + }, + "GetBuildTrigger": { + "methods": [ + "getBuildTrigger" + ] + }, + "DeleteBuildTrigger": { + "methods": [ + "deleteBuildTrigger" + ] + }, + "UpdateBuildTrigger": { + "methods": [ + "updateBuildTrigger" + ] + }, + "ReceiveTriggerWebhook": { + "methods": [ + "receiveTriggerWebhook" + ] + }, + "GetWorkerPool": { + "methods": [ + "getWorkerPool" + ] + }, + "CreateBuild": { + "methods": [ + "createBuild" + ] + }, + "RetryBuild": { + "methods": [ + "retryBuild" + ] + }, + "ApproveBuild": { + "methods": [ + "approveBuild" + ] + }, + "RunBuildTrigger": { + "methods": [ + "runBuildTrigger" + ] + }, + "CreateWorkerPool": { + "methods": [ + "createWorkerPool" + ] + }, + "DeleteWorkerPool": { + "methods": [ + "deleteWorkerPool" + ] + }, + "UpdateWorkerPool": { + "methods": [ + "updateWorkerPool" + ] + }, + "ListBuilds": { + "methods": [ + "listBuilds", + "listBuildsStream", + "listBuildsAsync" + ] + }, + "ListBuildTriggers": { + "methods": [ + "listBuildTriggers", + "listBuildTriggersStream", + "listBuildTriggersAsync" + ] + }, + "ListWorkerPools": { + "methods": [ + "listWorkerPools", + "listWorkerPoolsStream", + "listWorkerPoolsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudBuildClient", + "rpcs": { + "GetBuild": { + "methods": [ + "getBuild" + ] + }, + "CancelBuild": { + "methods": [ + "cancelBuild" + ] + }, + "CreateBuildTrigger": { + "methods": [ + "createBuildTrigger" + ] + }, + "GetBuildTrigger": { + "methods": [ + "getBuildTrigger" + ] + }, + "DeleteBuildTrigger": { + "methods": [ + "deleteBuildTrigger" + ] + }, + "UpdateBuildTrigger": { + "methods": [ + "updateBuildTrigger" + ] + }, + "ReceiveTriggerWebhook": { + "methods": [ + "receiveTriggerWebhook" + ] + }, + "GetWorkerPool": { + "methods": [ + "getWorkerPool" + ] + }, + "CreateBuild": { + "methods": [ + "createBuild" + ] + }, + "RetryBuild": { + "methods": [ + "retryBuild" + ] + }, + "ApproveBuild": { + "methods": [ + "approveBuild" + ] + }, + "RunBuildTrigger": { + "methods": [ + "runBuildTrigger" + ] + }, + "CreateWorkerPool": { + "methods": [ + "createWorkerPool" + ] + }, + "DeleteWorkerPool": { + "methods": [ + "deleteWorkerPool" + ] + }, + "UpdateWorkerPool": { + "methods": [ + "updateWorkerPool" + ] + }, + "ListBuilds": { + "methods": [ + "listBuilds", + "listBuildsStream", + "listBuildsAsync" + ] + }, + "ListBuildTriggers": { + "methods": [ + "listBuildTriggers", + "listBuildTriggersStream", + "listBuildTriggersAsync" + ] + }, + "ListWorkerPools": { + "methods": [ + "listWorkerPools", + "listWorkerPoolsStream", + "listWorkerPoolsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-devtools-cloudbuild/src/v1/index.ts b/packages/google-devtools-cloudbuild/src/v1/index.ts new file mode 100644 index 000000000000..82733a09aef4 --- /dev/null +++ b/packages/google-devtools-cloudbuild/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CloudBuildClient} from './cloud_build_client'; diff --git a/packages/google-devtools-cloudbuild/system-test/fixtures/sample/src/index.js b/packages/google-devtools-cloudbuild/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..e17f4a5c0e8c --- /dev/null +++ b/packages/google-devtools-cloudbuild/system-test/fixtures/sample/src/index.js @@ -0,0 +1,26 @@ +// 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 cloudbuild = require('@google-cloud/cloudbuild'); + +function main() { + const cloudBuildClient = new cloudbuild.CloudBuildClient(); +} + +main(); diff --git a/packages/google-devtools-cloudbuild/system-test/fixtures/sample/src/index.ts b/packages/google-devtools-cloudbuild/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..62c1bda66035 --- /dev/null +++ b/packages/google-devtools-cloudbuild/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// 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 {CloudBuildClient} from '@google-cloud/cloudbuild'; + +// check that the client class type name can be used +function doStuffWithCloudBuildClient(client: CloudBuildClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudBuildClient = new CloudBuildClient(); + doStuffWithCloudBuildClient(cloudBuildClient); +} + +main(); diff --git a/packages/google-devtools-cloudbuild/system-test/install.ts b/packages/google-devtools-cloudbuild/system-test/install.ts new file mode 100644 index 000000000000..6dd1eaadafaa --- /dev/null +++ b/packages/google-devtools-cloudbuild/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-devtools-cloudbuild/system-test/system.js b/packages/google-devtools-cloudbuild/system-test/system.js new file mode 100644 index 000000000000..26cd88c2a4cb --- /dev/null +++ b/packages/google-devtools-cloudbuild/system-test/system.js @@ -0,0 +1,31 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +const {assert} = require('chai'); +const {describe, it} = require('mocha'); +const {CloudBuildClient} = require('../'); +const PROJECT_ID = process.env.GCLOUD_PROJECT; +const cb = new CloudBuildClient(); + +describe('Integration Tests', () => { + it('should list triggers on project', async () => { + const [result] = await cb.listBuildTriggers({ + projectId: PROJECT_ID, + }); + assert.ok(result.length > 0); + }); +}); diff --git a/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts b/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts new file mode 100644 index 000000000000..45cff8de2a31 --- /dev/null +++ b/packages/google-devtools-cloudbuild/test/gapic_cloud_build_v1.ts @@ -0,0 +1,4755 @@ +// 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 cloudbuildModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.CloudBuildClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = cloudbuildModule.v1.CloudBuildClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = cloudbuildModule.v1.CloudBuildClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = cloudbuildModule.v1.CloudBuildClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudbuildModule.v1.CloudBuildClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudBuildStub, undefined); + await client.initialize(); + assert(client.cloudBuildStub); + }); + + it('has close method for the initialized client', done => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudBuildStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudBuildStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudbuildModule.v1.CloudBuildClient({ + 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 cloudbuildModule.v1.CloudBuildClient({ + 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('getBuild', () => { + it('invokes getBuild without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.Build() + ); + client.innerApiCalls.getBuild = stubSimpleCall(expectedResponse); + const [response] = await client.getBuild(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBuild without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.Build() + ); + client.innerApiCalls.getBuild = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBuild( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuild | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBuild with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBuild = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBuild(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBuild with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBuild(request), expectedError); + }); + }); + + describe('cancelBuild', () => { + it('invokes cancelBuild without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.Build() + ); + client.innerApiCalls.cancelBuild = stubSimpleCall(expectedResponse); + const [response] = await client.cancelBuild(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelBuild without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.Build() + ); + client.innerApiCalls.cancelBuild = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelBuild( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuild | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelBuild with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelBuild = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelBuild(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelBuild with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CancelBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CancelBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelBuild(request), expectedError); + }); + }); + + describe('createBuildTrigger', () => { + it('invokes createBuildTrigger without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ); + client.innerApiCalls.createBuildTrigger = + stubSimpleCall(expectedResponse); + const [response] = await client.createBuildTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBuildTrigger without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ); + client.innerApiCalls.createBuildTrigger = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBuildTrigger( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuildTrigger | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBuildTrigger with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBuildTrigger = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createBuildTrigger(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBuildTrigger with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildTriggerRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBuildTrigger(request), expectedError); + }); + }); + + describe('getBuildTrigger', () => { + it('invokes getBuildTrigger without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ); + client.innerApiCalls.getBuildTrigger = stubSimpleCall(expectedResponse); + const [response] = await client.getBuildTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBuildTrigger without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ); + client.innerApiCalls.getBuildTrigger = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBuildTrigger( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuildTrigger | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBuildTrigger with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBuildTrigger = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBuildTrigger(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBuildTrigger with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBuildTrigger(request), expectedError); + }); + }); + + describe('deleteBuildTrigger', () => { + it('invokes deleteBuildTrigger without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBuildTrigger = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteBuildTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBuildTrigger without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBuildTrigger = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBuildTrigger( + 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.deleteBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBuildTrigger with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBuildTrigger = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBuildTrigger(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBuildTrigger with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteBuildTrigger(request), expectedError); + }); + }); + + describe('updateBuildTrigger', () => { + it('invokes updateBuildTrigger without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + request.trigger ??= {}; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['trigger', 'resourceName'] + ); + request.trigger.resourceName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&trigger.resource_name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ); + client.innerApiCalls.updateBuildTrigger = + stubSimpleCall(expectedResponse); + const [response] = await client.updateBuildTrigger(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBuildTrigger without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + request.trigger ??= {}; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['trigger', 'resourceName'] + ); + request.trigger.resourceName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&trigger.resource_name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ); + client.innerApiCalls.updateBuildTrigger = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBuildTrigger( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuildTrigger | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBuildTrigger with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + request.trigger ??= {}; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['trigger', 'resourceName'] + ); + request.trigger.resourceName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&trigger.resource_name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBuildTrigger = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBuildTrigger(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBuildTrigger with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + request.trigger ??= {}; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest', + ['trigger', 'resourceName'] + ); + request.trigger.resourceName = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBuildTrigger(request), expectedError); + }); + }); + + describe('receiveTriggerWebhook', () => { + it('invokes receiveTriggerWebhook without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['trigger'] + ); + request.trigger = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse() + ); + client.innerApiCalls.receiveTriggerWebhook = + stubSimpleCall(expectedResponse); + const [response] = await client.receiveTriggerWebhook(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.receiveTriggerWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.receiveTriggerWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes receiveTriggerWebhook without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['trigger'] + ); + request.trigger = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse() + ); + client.innerApiCalls.receiveTriggerWebhook = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.receiveTriggerWebhook( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IReceiveTriggerWebhookResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.receiveTriggerWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.receiveTriggerWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes receiveTriggerWebhook with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['trigger'] + ); + request.trigger = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.receiveTriggerWebhook = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.receiveTriggerWebhook(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.receiveTriggerWebhook as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.receiveTriggerWebhook as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes receiveTriggerWebhook with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['trigger'] + ); + request.trigger = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.receiveTriggerWebhook(request), + expectedError + ); + }); + }); + + describe('getWorkerPool', () => { + it('invokes getWorkerPool without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ); + client.innerApiCalls.getWorkerPool = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkerPool(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkerPool without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ); + client.innerApiCalls.getWorkerPool = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkerPool( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IWorkerPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkerPool with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkerPool = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWorkerPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkerPool with closed client', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.GetWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkerPool(request), expectedError); + }); + }); + + describe('createBuild', () => { + it('invokes createBuild without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBuild = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBuild(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBuild without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBuild = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBuild( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBuild with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBuild = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBuild(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBuild with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateBuildRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBuild = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBuild(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBuildProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBuildProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBuildProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateBuildProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('retryBuild', () => { + it('invokes retryBuild without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.retryBuild = stubLongRunningCall(expectedResponse); + const [operation] = await client.retryBuild(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryBuild without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.retryBuild = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retryBuild( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryBuild with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retryBuild = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.retryBuild(request), expectedError); + const actualRequest = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retryBuild with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['id'] + ); + request.id = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RetryBuildRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retryBuild = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.retryBuild(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retryBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRetryBuildProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRetryBuildProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRetryBuildProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkRetryBuildProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('approveBuild', () => { + it('invokes approveBuild without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ApproveBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ApproveBuildRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.approveBuild = stubLongRunningCall(expectedResponse); + const [operation] = await client.approveBuild(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveBuild without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ApproveBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ApproveBuildRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.approveBuild = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.approveBuild( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveBuild with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ApproveBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ApproveBuildRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.approveBuild = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.approveBuild(request), expectedError); + const actualRequest = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes approveBuild with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ApproveBuildRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ApproveBuildRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.approveBuild = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.approveBuild(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.approveBuild as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkApproveBuildProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkApproveBuildProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkApproveBuildProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkApproveBuildProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('runBuildTrigger', () => { + it('invokes runBuildTrigger without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runBuildTrigger = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runBuildTrigger(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runBuildTrigger without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.runBuildTrigger = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runBuildTrigger( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runBuildTrigger with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runBuildTrigger = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.runBuildTrigger(request), expectedError); + const actualRequest = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes runBuildTrigger with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['triggerId'] + ); + request.triggerId = defaultValue2; + const defaultValue3 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.RunBuildTriggerRequest', + ['name'] + ); + request.name = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&trigger_id=${defaultValue2}&name=${defaultValue3}`; + const expectedError = new Error('expected'); + client.innerApiCalls.runBuildTrigger = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.runBuildTrigger(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.runBuildTrigger as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRunBuildTriggerProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRunBuildTriggerProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRunBuildTriggerProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRunBuildTriggerProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createWorkerPool', () => { + it('invokes createWorkerPool without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkerPool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkerPool without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkerPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkerPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkerPool with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkerPool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createWorkerPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkerPool with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkerPool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateWorkerPoolProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateWorkerPoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkerPoolProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateWorkerPoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteWorkerPool', () => { + it('invokes deleteWorkerPool without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkerPool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkerPool without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkerPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkerPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkerPool with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteWorkerPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkerPool with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteWorkerPoolProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteWorkerPoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteWorkerPoolProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteWorkerPoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateWorkerPool', () => { + it('invokes updateWorkerPool without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest', + ['workerPool', 'name'] + ); + request.workerPool.name = defaultValue1; + const expectedHeaderRequestParams = `worker_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkerPool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkerPool without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest', + ['workerPool', 'name'] + ); + request.workerPool.name = defaultValue1; + const expectedHeaderRequestParams = `worker_pool.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkerPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkerPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkerPool with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest', + ['workerPool', 'name'] + ); + request.workerPool.name = defaultValue1; + const expectedHeaderRequestParams = `worker_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateWorkerPool(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkerPool with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest', + ['workerPool', 'name'] + ); + request.workerPool.name = defaultValue1; + const expectedHeaderRequestParams = `worker_pool.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkerPool as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateWorkerPoolProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateWorkerPoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkerPoolProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateWorkerPoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listBuilds', () => { + it('invokes listBuilds without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + ]; + client.innerApiCalls.listBuilds = stubSimpleCall(expectedResponse); + const [response] = await client.listBuilds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBuilds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuilds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuilds without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + ]; + client.innerApiCalls.listBuilds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBuilds( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuild[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBuilds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuilds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuilds with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBuilds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBuilds(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBuilds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuilds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuildsStream without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + ]; + client.descriptors.page.listBuilds.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBuildsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.Build[] = []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.Build) => { + 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.listBuilds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuilds, request) + ); + assert( + (client.descriptors.page.listBuilds.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBuildsStream with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBuilds.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBuildsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.Build[] = []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.Build) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBuilds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuilds, request) + ); + assert( + (client.descriptors.page.listBuilds.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBuilds without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + ]; + client.descriptors.page.listBuilds.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devtools.cloudbuild.v1.IBuild[] = []; + const iterable = client.listBuildsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBuilds with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildsRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBuilds.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBuildsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devtools.cloudbuild.v1.IBuild[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBuildTriggers', () => { + it('invokes listBuildTriggers without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.innerApiCalls.listBuildTriggers = stubSimpleCall(expectedResponse); + const [response] = await client.listBuildTriggers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBuildTriggers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuildTriggers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuildTriggers without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.innerApiCalls.listBuildTriggers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBuildTriggers( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBuildTriggers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuildTriggers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuildTriggers with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBuildTriggers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBuildTriggers(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBuildTriggers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBuildTriggers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBuildTriggersStream without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.descriptors.page.listBuildTriggers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBuildTriggersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.BuildTrigger[] = + []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.BuildTrigger) => { + 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.listBuildTriggers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuildTriggers, request) + ); + assert( + (client.descriptors.page.listBuildTriggers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBuildTriggersStream with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBuildTriggers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBuildTriggersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.BuildTrigger[] = + []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.BuildTrigger) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBuildTriggers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuildTriggers, request) + ); + assert( + (client.descriptors.page.listBuildTriggers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBuildTriggers without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.descriptors.page.listBuildTriggers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] = + []; + const iterable = client.listBuildTriggersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBuildTriggers with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['projectId'] + ); + request.projectId = defaultValue1; + const defaultValue2 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListBuildTriggersRequest', + ['parent'] + ); + request.parent = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1}&parent=${defaultValue2}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBuildTriggers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBuildTriggersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listWorkerPools', () => { + it('invokes listWorkerPools without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + ]; + client.innerApiCalls.listWorkerPools = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkerPools(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkerPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkerPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkerPools without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + ]; + client.innerApiCalls.listWorkerPools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkerPools( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IWorkerPool[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkerPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkerPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkerPools with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkerPools = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listWorkerPools(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listWorkerPools as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkerPools as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkerPoolsStream without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + ]; + client.descriptors.page.listWorkerPools.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkerPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.WorkerPool[] = []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.WorkerPool) => { + 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.listWorkerPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkerPools, request) + ); + assert( + (client.descriptors.page.listWorkerPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listWorkerPoolsStream with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkerPools.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkerPoolsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.WorkerPool[] = []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.WorkerPool) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWorkerPools.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkerPools, request) + ); + assert( + (client.descriptors.page.listWorkerPools.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkerPools without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.WorkerPool() + ), + ]; + client.descriptors.page.listWorkerPools.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devtools.cloudbuild.v1.IWorkerPool[] = []; + const iterable = client.listWorkerPoolsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkerPools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkerPools with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkerPools.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkerPoolsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devtools.cloudbuild.v1.IWorkerPool[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkerPools.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listWorkerPools.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('cryptoKey', () => { + const fakePath = '/rendered/path/cryptoKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + keyring: 'keyringValue', + key: 'keyValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath( + 'projectValue', + 'locationValue', + 'keyringValue', + 'keyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyringFromCryptoKeyName', () => { + const result = client.matchKeyringFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyringValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyFromCryptoKeyName', () => { + const result = client.matchKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + 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 cloudbuildModule.v1.CloudBuildClient({ + 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('projectBuild', () => { + const fakePath = '/rendered/path/projectBuild'; + const expectedParameters = { + project: 'projectValue', + build: 'buildValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectBuildPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectBuildPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectBuildPath', () => { + const result = client.projectBuildPath('projectValue', 'buildValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectBuildPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectBuildName', () => { + const result = client.matchProjectFromProjectBuildName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectBuildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBuildFromProjectBuildName', () => { + const result = client.matchBuildFromProjectBuildName(fakePath); + assert.strictEqual(result, 'buildValue'); + assert( + (client.pathTemplates.projectBuildPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationBuild', () => { + const fakePath = '/rendered/path/projectLocationBuild'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + build: 'buildValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationBuildPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationBuildPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationBuildPath', () => { + const result = client.projectLocationBuildPath( + 'projectValue', + 'locationValue', + 'buildValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationBuildPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationBuildName', () => { + const result = + client.matchProjectFromProjectLocationBuildName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationBuildPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationBuildName', () => { + const result = + client.matchLocationFromProjectLocationBuildName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationBuildPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBuildFromProjectLocationBuildName', () => { + const result = client.matchBuildFromProjectLocationBuildName(fakePath); + assert.strictEqual(result, 'buildValue'); + assert( + ( + client.pathTemplates.projectLocationBuildPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationTrigger', () => { + const fakePath = '/rendered/path/projectLocationTrigger'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + trigger: 'triggerValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationTriggerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationTriggerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationTriggerPath', () => { + const result = client.projectLocationTriggerPath( + 'projectValue', + 'locationValue', + 'triggerValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationTriggerPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationTriggerName', () => { + const result = + client.matchProjectFromProjectLocationTriggerName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationTriggerPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationTriggerName', () => { + const result = + client.matchLocationFromProjectLocationTriggerName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationTriggerPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTriggerFromProjectLocationTriggerName', () => { + const result = + client.matchTriggerFromProjectLocationTriggerName(fakePath); + assert.strictEqual(result, 'triggerValue'); + assert( + ( + client.pathTemplates.projectLocationTriggerPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectTrigger', () => { + const fakePath = '/rendered/path/projectTrigger'; + const expectedParameters = { + project: 'projectValue', + trigger: 'triggerValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectTriggerPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectTriggerPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectTriggerPath', () => { + const result = client.projectTriggerPath( + 'projectValue', + 'triggerValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectTriggerPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectTriggerName', () => { + const result = client.matchProjectFromProjectTriggerName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectTriggerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTriggerFromProjectTriggerName', () => { + const result = client.matchTriggerFromProjectTriggerName(fakePath); + assert.strictEqual(result, 'triggerValue'); + assert( + (client.pathTemplates.projectTriggerPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('secretVersion', () => { + const fakePath = '/rendered/path/secretVersion'; + const expectedParameters = { + project: 'projectValue', + secret: 'secretValue', + version: 'versionValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.secretVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.secretVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('secretVersionPath', () => { + const result = client.secretVersionPath( + 'projectValue', + 'secretValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.secretVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSecretVersionName', () => { + const result = client.matchProjectFromSecretVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.secretVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSecretFromSecretVersionName', () => { + const result = client.matchSecretFromSecretVersionName(fakePath); + assert.strictEqual(result, 'secretValue'); + assert( + (client.pathTemplates.secretVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromSecretVersionName', () => { + const result = client.matchVersionFromSecretVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.secretVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('serviceAccount', () => { + const fakePath = '/rendered/path/serviceAccount'; + const expectedParameters = { + project: 'projectValue', + service_account: 'serviceAccountValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.serviceAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.serviceAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('serviceAccountPath', () => { + const result = client.serviceAccountPath( + 'projectValue', + 'serviceAccountValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.serviceAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServiceAccountName', () => { + const result = client.matchProjectFromServiceAccountName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.serviceAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceAccountFromServiceAccountName', () => { + const result = + client.matchServiceAccountFromServiceAccountName(fakePath); + assert.strictEqual(result, 'serviceAccountValue'); + assert( + (client.pathTemplates.serviceAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('subscription', () => { + const fakePath = '/rendered/path/subscription'; + const expectedParameters = { + project: 'projectValue', + subscription: 'subscriptionValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subscriptionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subscriptionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subscriptionPath', () => { + const result = client.subscriptionPath( + 'projectValue', + 'subscriptionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subscriptionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSubscriptionName', () => { + const result = client.matchProjectFromSubscriptionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSubscriptionFromSubscriptionName', () => { + const result = client.matchSubscriptionFromSubscriptionName(fakePath); + assert.strictEqual(result, 'subscriptionValue'); + assert( + (client.pathTemplates.subscriptionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('topic', () => { + const fakePath = '/rendered/path/topic'; + const expectedParameters = { + project: 'projectValue', + topic: 'topicValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.topicPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.topicPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('topicPath', () => { + const result = client.topicPath('projectValue', 'topicValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.topicPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTopicName', () => { + const result = client.matchProjectFromTopicName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.topicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTopicFromTopicName', () => { + const result = client.matchTopicFromTopicName(fakePath); + assert.strictEqual(result, 'topicValue'); + assert( + (client.pathTemplates.topicPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workerPool', () => { + const fakePath = '/rendered/path/workerPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + worker_pool: 'workerPoolValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath( + 'projectValue', + 'locationValue', + 'workerPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'workerPoolValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-devtools-cloudbuild/tsconfig.json b/packages/google-devtools-cloudbuild/tsconfig.json new file mode 100644 index 000000000000..c78f1c884ef6 --- /dev/null +++ b/packages/google-devtools-cloudbuild/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-devtools-cloudbuild/webpack.config.js b/packages/google-devtools-cloudbuild/webpack.config.js new file mode 100644 index 000000000000..2760608e03da --- /dev/null +++ b/packages/google-devtools-cloudbuild/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'CloudBuild', + filename: './cloud-build.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', +};